Skip to content

Apply the global scale to spacing once, and scale TransformBox and GradientEditor handles - #618

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-c54y2k
Oct 11, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-c54y2k

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: at a UI scale of 200% (SetGlobalScale(2) or Accessibility > UI Scale) the font doubled but every padding and spacing grew fourfold, and TransformBox's handles and GradientEditor's markers stayed their 100% size, so they were small and hard to grab next to the larger text.

After: spacing grows by the same factor as the font, and those widgets' handles, grab reach and markers grow with the text.

RenderWithScaling multiplied the style by the font's scale ratio, which already includes GlobalScale, and then by GlobalScale again. It now uses the font ratio alone.

How: a new internal InterfaceScale.Current (font size over the 14 px the widgets were designed at) scales TransformBox's corner and edge bars and its grab reach (TransformBoxState.HitTest takes an optional grabPixels), and GradientEditor's marker row, swatches, grab radius and removal distance. InterfaceScaleTests pins the font and spacing to the same factor, and TransformBox_CornerReachGrowsWithTheInterfaceScale pins the reach. Found while adding ImageGui's Interface size preference.

Tested locally (Actions is at its budget limit): ImGui.Widgets.Tests, ImGui.App.Tests and ImGui.Widgets.UITests all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALcNfGFpHyJUJjKLiEuf7N


Generated by Claude Code

…x and GradientEditor handles

RenderWithScaling multiplied the style's spacing by the font's scale ratio,
which already includes GlobalScale, and then by GlobalScale again, so at
200% every padding and spacing was four times its size. It now scales by the
font ratio alone.

TransformBox's handles and grab reach, and GradientEditor's markers, grab
radius and removal distance, were fixed pixel lengths that stayed the same
size as the text around them grew. They now scale by the font size over
the 14 px they were designed at (InterfaceScale.Current).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALcNfGFpHyJUJjKLiEuf7N
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALcNfGFpHyJUJjKLiEuf7N
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