Repository navigation
Apply the global scale to spacing once, and scale TransformBox and GradientEditor handles - #618
Merged
Merged
Conversation
…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
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andTransformBox's handles andGradientEditor'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.
RenderWithScalingmultiplied the style by the font's scale ratio, which already includesGlobalScale, and then byGlobalScaleagain. It now uses the font ratio alone.How: a new internal
InterfaceScale.Current(font size over the 14 px the widgets were designed at) scalesTransformBox's corner and edge bars and its grab reach (TransformBoxState.HitTesttakes an optionalgrabPixels), andGradientEditor's marker row, swatches, grab radius and removal distance.InterfaceScaleTestspins the font and spacing to the same factor, andTransformBox_CornerReachGrowsWithTheInterfaceScalepins 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