From 8ca0bf745a06ea49f36d9f12d6c144e113a63568 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 3 Jun 2014 22:36:38 +0300 Subject: [PATCH] Fixed bug in my previous commit --- src/toolbar_gui.cpp | 2 +- src/window.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index bc314eb67f..23fb21e5f8 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1040,7 +1040,7 @@ static CallBackFunction PlaceLandBlockInfo() ResetObjectToPlace(); return CBF_NONE; } else { - SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, HT_RECT, WC_MAIN_TOOLBAR, 0); + SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, HT_RECT, _settings_client.gui.vertical_toolbar ? WC_MAIN_TOOLBAR_RIGHT : WC_MAIN_TOOLBAR, 0); return CBF_PLACE_LANDINFO; } } diff --git a/src/window.cpp b/src/window.cpp index 67cc604332..4cc7e1b963 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1723,9 +1723,9 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int if (pt.x > _screen.width + 10 - default_width) { pt.x = (_screen.width + 10 - default_width) - 20; } - const Window *w = FindWindowById(WC_MAIN_TOOLBAR_RIGHT, 0); - if (w && pt.x + default_width > _screen.width - w->width ) { - pt.x = _screen.width - w->width - default_width; + const Window *wt = FindWindowById(WC_MAIN_TOOLBAR_RIGHT, 0); + if (wt && pt.x + default_width > _screen.width - wt->width) { + pt.x = _screen.width - wt->width - default_width; } pt.y = w->top + ((desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) ? w->height : 10); @@ -2897,6 +2897,8 @@ static void MouseLoop(MouseClick click, int mousewheel) (_settings_client.gui.left_mouse_btn_scrolling || _move_pressed)) { _scrolling_viewport = true; _cursor.fix_at = false; + } else { + _left_button_dragged = true; } mouse_down_on_viewport = true; break;