summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2006-12-03 13:40:16 +0000
committerKUDr <KUDr@openttd.org>2006-12-03 13:40:16 +0000
commit7cc06c10d97cf6ef08a673480a50b69b7d2dacdf (patch)
treeb374b745740ad69e6321c72463c00e9f6aa920a3
parent40fb1c2a544463bfc98984e2588dc0e586adb802 (diff)
downloadopenttd-7cc06c10d97cf6ef08a673480a50b69b7d2dacdf.tar.xz
(svn r7329) -Fix (r7157): Invalid viewport position on quick zoom
-rw-r--r--main_gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main_gui.c b/main_gui.c
index edfafbe20..8ecd7c988 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -881,7 +881,10 @@ bool DoZoomInOutWindow(int how, Window *w)
vp->virtual_height <<= 1;
break;
}
-
+ if (vp != NULL) { // the vp can be null when how == ZOOM_NONE
+ vp->virtual_left = WP(w, vp_d).scrollpos_x;
+ vp->virtual_top = WP(w, vp_d).scrollpos_y;
+ }
SetWindowDirty(w);
/* Update the windows that have zoom-buttons to perhaps disable their buttons */
SendWindowMessageClass(w->window_class, how, w->window_number, 0);