Repository navigation
Apply visualizer mouse display scaling once - #3245
Merged
breiler merged 2 commits intoNov 5, 2026
Merged
Conversation
Apply the component’s display scale once for mouse movement and dragging, with an identity fallback when no graphics configuration is available. Projection now accepts drawable pixel coordinates directly. Fixes winder#3241
Contributor
Author
|
Thanks for merging this @breiler. Applying the display scale once should keep the visualizer's mouse cone lined up with the cursor on scaled displays. |
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.
Background
On scaled displays, the visualizer’s mouse cone can drift from the cursor and report incorrect coordinates.
Mouse coordinates were scaled in RendererInputHandler, then scaled again during projection. The first conversion also used the default screen’s scale instead of the event component’s display scale.
Summary of the fix
Apply the component’s display scale once for mouse movement and dragging, with an identity fallback when no graphics configuration is available. Projection now accepts drawable pixel coordinates directly.
Verification
./mvnw -B -ntp -pl ugs-platform/ugs-platform-visualizer -am test -Dtest=RendererInputHandlerTest,MouseProjectionUtilsTest -Dsurefire.failIfNoSpecifiedTests=falsepassed both regression tests. The tests inugs-platform/ugs-platform-visualizer/src/test/java/com/willwinder/ugs/nbm/visualizer/RendererInputHandlerTest.javaandugs-platform/ugs-platform-visualizer/src/test/java/com/willwinder/ugs/nbm/visualizer/shared/MouseProjectionUtilsTest.javafail without the fix in the Universal-G-Code-Sender RendererInputHandler change (checked by reverting the source changes).Fixes #3241