summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-05-15 16:08:46 +0000
committertruelight <truelight@openttd.org>2007-05-15 16:08:46 +0000
commit765c466b8d5f9a534f785a14b4c41e36e07ae014 (patch)
tree839525ed601a24ac844e1fb9f64be11f2890b982 /src/window.cpp
parentd4963476cb0226490143e9843df897f792feacb2 (diff)
downloadopenttd-765c466b8d5f9a534f785a14b4c41e36e07ae014.tar.xz
(svn r9846) -Codechange: introduced ZOOM_LVL_MIN and ZOOM_LVL_MAX for the obvious reasons
-Codechange: introduced ZOOM_LVL_DETAIL to show/remove details -Codechange: changed << and >> operator with ZoomLevel to a simple wrapper (that in theory also allows zoom-in besides the current zoom-out) -Fix r9845: missed some int -> ZoomLevel
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 34ccb70aa..f4309971a 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1618,14 +1618,14 @@ static void HandleAutoscroll()
/* here allows scrolling in both x and y axis */
#define scrollspeed 3
if (x - 15 < 0) {
- WP(w, vp_d).scrollpos_x += (x - 15) * scrollspeed << vp->zoom;
+ WP(w, vp_d).scrollpos_x += ScaleByZoom((x - 15) * scrollspeed, vp->zoom);
} else if (15 - (vp->width - x) > 0) {
- WP(w, vp_d).scrollpos_x += (15 - (vp->width - x)) * scrollspeed << vp->zoom;
+ WP(w, vp_d).scrollpos_x += ScaleByZoom((15 - (vp->width - x)) * scrollspeed, vp->zoom);
}
if (y - 15 < 0) {
- WP(w, vp_d).scrollpos_y += (y - 15) * scrollspeed << vp->zoom;
+ WP(w, vp_d).scrollpos_y += ScaleByZoom((y - 15) * scrollspeed, vp->zoom);
} else if (15 - (vp->height - y) > 0) {
- WP(w,vp_d).scrollpos_y += (15 - (vp->height - y)) * scrollspeed << vp->zoom;
+ WP(w,vp_d).scrollpos_y += ScaleByZoom((15 - (vp->height - y)) * scrollspeed, vp->zoom);
}
#undef scrollspeed
}
@@ -1970,8 +1970,8 @@ void RelocateAllWindows(int neww, int newh)
ViewPort *vp = w->viewport;
vp->width = w->width = neww;
vp->height = w->height = newh;
- vp->virtual_width = neww << vp->zoom;
- vp->virtual_height = newh << vp->zoom;
+ vp->virtual_width = ScaleByZoom(neww, vp->zoom);
+ vp->virtual_height = ScaleByZoom(newh, vp->zoom);
continue; // don't modify top,left
}