Step 119: zoom controls

This commit is contained in:
Bill
2026-02-09 13:04:58 -07:00
parent da3fec9f15
commit 4f61953e1a
6 changed files with 68 additions and 2 deletions

14
editor/src/ZoomUtils.h Normal file
View File

@@ -0,0 +1,14 @@
#pragma once
// Step 119: Zoom utilities
inline int clampFontSize(int size, int minSize = 12, int maxSize = 24) {
if (size < minSize) return minSize;
if (size > maxSize) return maxSize;
return size;
}
inline int zoomPercent(int fontSize, float baseFontSize) {
if (baseFontSize <= 0.0f) return 100;
float pct = (fontSize / baseFontSize) * 100.0f;
return (int)(pct + 0.5f);
}