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
commit3f3a14d24b95efe532e04c98ed5f568e97849fbb (patch)
treeb374b745740ad69e6321c72463c00e9f6aa920a3
parent306204c71d15cf5e7e8fab62dd470a4dde5c76b3 (diff)
downloadopenttd-3f3a14d24b95efe532e04c98ed5f568e97849fbb.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);