summaryrefslogtreecommitdiff
path: root/src/zoom_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zoom_func.h')
-rw-r--r--src/zoom_func.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/zoom_func.h b/src/zoom_func.h
index 5f1bf830d..1cb3d0c48 100644
--- a/src/zoom_func.h
+++ b/src/zoom_func.h
@@ -64,4 +64,24 @@ static inline int UnScaleByZoomLower(int value, ZoomLevel zoom)
return value >> zoom;
}
+/**
+ * Short-hand to apply GUI zoom level.
+ * @param value Pixel amount at #ZOOM_LVL_BEGIN (full zoom in).
+ * @return value Pixel amount at #ZOOM_LVL_GUI.
+ */
+static inline int UnScaleGUI(int value)
+{
+ return UnScaleByZoom(value, ZOOM_LVL_GUI);
+}
+
+/**
+ * Scale traditional pixel dimensions to GUI zoom level.
+ * @param value Pixel amount at 1x zoom level.
+ * @return value Pixel amount at #ZOOM_LVL_GUI.
+ */
+static inline int ScaleGUITrad(int value)
+{
+ return UnScaleGUI(value * ZOOM_LVL_BASE);
+}
+
#endif /* ZOOM_FUNC_H */