diff options
Diffstat (limited to 'src/zoom.hpp')
-rw-r--r-- | src/zoom.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zoom.hpp b/src/zoom.hpp index b05551475..e5e119452 100644 --- a/src/zoom.hpp +++ b/src/zoom.hpp @@ -10,6 +10,8 @@ enum ZoomLevel { ZOOM_LVL_NORMAL = 0, ZOOM_LVL_OUT_2X, ZOOM_LVL_OUT_4X, + ZOOM_LVL_OUT_8X, + ZOOM_LVL_OUT_16X, ZOOM_LVL_END, /* Here we define in which zoom viewports are */ @@ -26,19 +28,21 @@ enum ZoomLevel { ZOOM_LVL_DETAIL = ZOOM_LVL_OUT_2X, //! All zoomlevels below or equal to this, will result in details on the screen, like road-work, ... ZOOM_LVL_MIN = ZOOM_LVL_NORMAL, - ZOOM_LVL_MAX = ZOOM_LVL_OUT_4X, + ZOOM_LVL_MAX = ZOOM_LVL_OUT_16X, }; extern ZoomLevel _saved_scrollpos_zoom; static inline int ScaleByZoom(int value, ZoomLevel zoom) { + if (zoom == ZOOM_LVL_NORMAL) return value; int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL; return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> izoom; } static inline int UnScaleByZoom(int value, ZoomLevel zoom) { + if (zoom == ZOOM_LVL_NORMAL) return value; int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL; return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << izoom; } |