Fractional GUI scale (0.5 step), fit menu to window, fix settings pages

- display.gui-scale is now a number: 0 (auto) or 0.5..4 in 0.5 steps
- explicit scale is no longer limited by window size (tiled windows);
  only an open menu page is shrunk to fit the window
- snap Batch2D vertices to pixels on fractional scale (fixes dots above text)
- pass app to settings_common via options (not visible inside modules)
- gui.get_scale() returns a number
This commit is contained in:
loki5512344 2026-10-03 15:28:03 +02:00
parent 33e132a231
commit 48d5d54b77
13 changed files with 76 additions and 41 deletions

View file

@ -16,11 +16,11 @@ gui.str(text: str, context: str) -> str
-- Returns size of the main container (window).
gui.get_viewport() -> {int, int}
-- Returns current GUI scale: window pixels per one UI unit (1..4).
-- Set by the display.gui-scale setting and limited by window size.
gui.get_scale() -> int
-- Returns current GUI scale: window pixels per one UI unit (0.5..4).
-- Set by the display.gui-scale setting (auto mode fits the window size).
gui.get_scale() -> number
-- Returns maximal GUI scale that fits the current window size.
-- Returns GUI scale used in auto mode (fits the current window size).
gui.get_max_scale() -> int
-- Returns cursor position in UI units (unlike input.get_mouse_pos,