From 765c466b8d5f9a534f785a14b4c41e36e07ae014 Mon Sep 17 00:00:00 2001 From: truelight Date: Tue, 15 May 2007 16:08:46 +0000 Subject: (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 --- src/misc_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/misc_gui.cpp') diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index c63e3d6bd..2336d5332 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -579,11 +579,11 @@ void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y) vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport; /* move x pos to opposite corner */ - pt.x = ((pt.x - vp->virtual_left) >> vp->zoom) + vp->left; + pt.x = UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left; pt.x = (pt.x < (_screen.width >> 1)) ? _screen.width - 260 : 20; /* move y pos to opposite corner */ - pt.y = ((pt.y - vp->virtual_top) >> vp->zoom) + vp->top; + pt.y = UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top; pt.y = (pt.y < (_screen.height >> 1)) ? _screen.height - 80 : 100; } else { @@ -595,8 +595,8 @@ void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y) if ( (x|y) != 0) { pt = RemapCoords2(x, y); vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport; - pt.x = clamp(((pt.x - vp->virtual_left) >> vp->zoom) + vp->left - (334/2), 0, _screen.width - 334); - pt.y = clamp(((pt.y - vp->virtual_top) >> vp->zoom) + vp->top - (137/2), 22, _screen.height - 137); + pt.x = clamp(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (334/2), 0, _screen.width - 334); + pt.y = clamp(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (137/2), 22, _screen.height - 137); } else { pt.x = (_screen.width - 334) >> 1; pt.y = (_screen.height - 137) >> 1; -- cgit v1.2.3-54-g00ecf