summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-21 22:23:13 +0000
committerfrosch <frosch@openttd.org>2011-05-21 22:23:13 +0000
commit1f793041254689f61c1b409a26474269b89e14f5 (patch)
treea64c612e413b5d4bb7c4edcc2692adb29e380515 /src
parent351c7ab097390efb971ff0f410fb025599ef3ecc (diff)
downloadopenttd-1f793041254689f61c1b409a26474269b89e14f5.tar.xz
(svn r22485) -Fix: EnsureVisibleCaption() did not update viewport positions of windows with viewports but without caption. (only triggerable since r22484)
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 572be9f37..e5f5250d8 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1550,12 +1550,13 @@ static void EnsureVisibleCaption(Window *w, int nx, int ny)
/* Make sure the title bar isn't hidden behind the main tool bar or the status bar. */
PreventHiding(&nx, &ny, caption_rect, FindWindowById(WC_MAIN_TOOLBAR, 0), w->left, PHD_DOWN);
PreventHiding(&nx, &ny, caption_rect, FindWindowById(WC_STATUS_BAR, 0), w->left, PHD_UP);
+ }
- if (w->viewport != NULL) {
- w->viewport->left += nx - w->left;
- w->viewport->top += ny - w->top;
- }
+ if (w->viewport != NULL) {
+ w->viewport->left += nx - w->left;
+ w->viewport->top += ny - w->top;
}
+
w->left = nx;
w->top = ny;
}