Fixes for WayFinder and ZoomControl mouse interactions#28
Merged
Conversation
AndersPantzarWestermo
approved these changes
Jun 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request improves mouse-driven interactions in the Avalonia ZoomControl and fixes minimap (Wayfinder) rendering when trackable content has a positive top-left offset, with new automated tests covering both behaviors.
Changes:
- Refactors
ZoomControlpointer-drag handling into begin/move/complete interaction helpers and adjusts modifier gesture behavior (Alt zoom-box vs Ctrl+Alt area selection). - Fixes
WayfinderVisualBrush sampling to avoid clipping whenITrackableContent.ContentSizehas positive X/Y offsets. - Adds unit + render snapshot tests for the new interaction behavior and the Wayfinder offset rendering regression.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Westermo.GraphX.Controls.Avalonia/Controls/ZoomControl/ZoomControl.cs | Refactors pointer interaction flow and updates modifier-gesture handling; adds internal test hooks. |
| Westermo.GraphX.Controls.Avalonia/Controls/ZoomControl/Wayfinder.cs | Adjusts content-extent handling and VisualBrush source rect to prevent clipping for offset trackable content. |
| Westermo.GraphX.Controls.Avalonia.Tests/ZoomControlTests.cs | Adds tests for Alt-drag zoom-box and Ctrl+Alt-drag area selection behaviors. |
| Westermo.GraphX.Controls.Avalonia.Tests/WayfinderRenderTests.cs | Adds an end-to-end render test for offset ITrackableContent minimap rendering. |
| Westermo.GraphX.Controls.Avalonia.Tests/WayfinderRenderTests.Renders_OffsetTrackableContent_WithoutClippingLowerOrRightEdges.verified.txt | New verified snapshot for the offset-content render test. |
Comment on lines
729
to
732
| case KeyModifiers.Alt | KeyModifiers.Control: | ||
| case KeyModifiers.Alt: | ||
| _startedAsAreaSelection = true; | ||
| ModifierMode = ZoomViewModifierMode.ZoomBox; | ||
| break; |
Comment on lines
+733
to
+735
| case KeyModifiers.Alt: | ||
| ModifierMode = ZoomViewModifierMode.ZoomBox; | ||
| break; |
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.
No description provided.