DYN-4305: After panning, sometimes zooming doesn't zoom into the mouse position#13095
DYN-4305: After panning, sometimes zooming doesn't zoom into the mouse position#13095sm6srw merged 7 commits intoDynamoDS:masterfrom
Conversation
| tt.X = p.X; | ||
| tt.Y = p.Y; | ||
| var tt = GetChildTranslateTransform(); | ||
| if (tt.X != p.X || tt.Y != p.Y) |
There was a problem hiding this comment.
Keeping code that stops propagation if nothing has changed.
| private void child_MouseWheel(object sender, MouseWheelEventArgs e) | ||
| { | ||
| if (child != null) | ||
| if (child != null && !child.IsMouseCaptured) |
There was a problem hiding this comment.
Do not allow zoom if middle button is down. This caused zoom to jump.
| //set the current offset without triggering | ||
| //any property change notices. | ||
| if (Model.X != p.X && Model.Y != p.Y) | ||
| if (Model.X != p.X || Model.Y != p.Y) |
There was a problem hiding this comment.
This was the second bug. Zoom jumped if only X or Y changed during pan.
| // Change ZoomBorder's child translation | ||
| Vector v = start - e.GetPosition(this); | ||
|
|
||
| if (v.Length == 0.0) |
There was a problem hiding this comment.
maybe use a tolerance ? I guess it does not matter that much...
There was a problem hiding this comment.
I was thinking of it but the values I have seen here have been 0,1,2 etc and 0 has been 0 in those cases. So I think this is good enough.
| { | ||
| st.ScaleX = zoom; | ||
| st.ScaleY = zoom; | ||
| var tt = GetTranslateTransform(child); |
There was a problem hiding this comment.
GetChildTranslateTransform() ?
I saw you used this method at line 103
There was a problem hiding this comment.
Yes, could be used here. I may do a pass and use the child version of these methods.
pinzart90
left a comment
There was a problem hiding this comment.
A couple of minor comments
Purpose
This pull request does:
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Initiating a zoom right after a pan no longer sporadically zooms around the wrong position.
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of