Skip to content

iris-gui: scaling fixes and window resize - #111

Merged
techomancer merged 1 commit into
techomancer:mainfrom
iblowmymind:fb-scaling-fix
Sep 17, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
iblowmymind:fb-scaling-fix

Conversation

@iblowmymind

Copy link
Copy Markdown
Contributor

View > VM screen at 1x measured ~0.9x, and a window resized to ~1x lost rows of pixels. Separately, fullscreen ignored the setting and blew the picture up to a filtered 1.05x, and changing the scale while fullscreen shrank the whole UI into a corner.

  • snap_window_to_fb capped the window at 85% of the monitor, silently reducing the requested scale. Reserve only the measured title bar; no guessed menu bar/taskbar allowance either, since 1280x1024 at 1x on a 1080p screen has ~3 points to spare. If the window manager constrains the window anyway, the draw falls back to a filtered fit. Request 1pt of slack so WM rounding can't land just short of 1x.

  • is_integer_scale accepted scales within 1% of an integer and drew NEAREST at that slightly-off size, dropping rows. fb_draw_size now snaps a fit that lands just above an integer device scale down to exactly that integer (never up, which would clip), and uses LINEAR otherwise.

  • centered_and_justified put the image origin on a fractional device pixel. fb_draw_rect snaps the rect to the device-pixel grid and paint_fb paints it directly so layout doesn't re-round it. Both heads use it.

  • The VM screen setting is now the maximum draw scale: a larger window (fullscreen, maximised, manual resize) centres the picture at the chosen scale instead of stretching it; only a smaller window shrinks it to fit.

  • snap_window_to_fb doesn't resize a fullscreen window (InnerSize just shrank the rendered area); the request stays pending and is applied once fullscreen ends.

Cross-platform, no new dependencies. Adds unit tests for the draw geometry.

View > VM screen at 1x measured ~0.9x, and a window resized to ~1x
lost rows of pixels. Separately, fullscreen ignored the setting and
blew the picture up to a filtered 1.05x, and changing the scale while
fullscreen shrank the whole UI into a corner.

- snap_window_to_fb capped the window at 85% of the monitor, silently
  reducing the requested scale. Reserve only the measured title bar;
  no guessed menu bar/taskbar allowance either, since 1280x1024 at 1x
  on a 1080p screen has ~3 points to spare. If the window manager
  constrains the window anyway, the draw falls back to a filtered fit.
  Request 1pt of slack so WM rounding can't land just short of 1x.

- is_integer_scale accepted scales within 1% of an integer and drew
  NEAREST at that slightly-off size, dropping rows. fb_draw_size now
  snaps a fit that lands just above an integer device scale down to
  exactly that integer (never up, which would clip), and uses LINEAR
  otherwise.

- centered_and_justified put the image origin on a fractional device
  pixel. fb_draw_rect snaps the rect to the device-pixel grid and
  paint_fb paints it directly so layout doesn't re-round it. Both
  heads use it.

- The VM screen setting is now the maximum draw scale: a larger window
  (fullscreen, maximised, manual resize) centres the picture at the
  chosen scale instead of stretching it; only a smaller window shrinks
  it to fit.

- snap_window_to_fb doesn't resize a fullscreen window (InnerSize just
  shrank the rendered area); the request stays pending and is applied
  once fullscreen ends.

Cross-platform, no new dependencies. Adds unit tests for the draw
geometry.
@techomancer
techomancer merged commit e93c5bb into techomancer:main Sep 17, 2026
1 check passed
@iblowmymind
iblowmymind deleted the fb-scaling-fix branch September 17, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants