Open jpk6789 opened 6 months ago
Hi! The NodifyEditor.BringIntoView
method centers the viewport to the specified location (as written in the summary: Moves the viewport center at the specified location.
), and it's working as intended. However, the editor command bound to the ResetViewportLocation
gesture is wrong and the summary of the BringIntoView
routed UI command is also wrong.
I would not change the behavior of NodifyEditor.BringIntoView
but instead create another command for resetting the viewport location. Setting the ViewportLocation
to any location moves the top-left corner of the viewport to that location.
Ok, then I change my PR accordingly and create a new command for that. Yes, I saw that the top-left corner is set by the ViewportLocation :) But if I add this new function, would it be ok to also reset the zoom factor to 1 in it? I expected such a function to fully reset the location / scale in the first place.
It's ok to reset the zooming. But in this case, I would give it a generic name like ResetViewport
.
Describe the bug If the
ResetViewportLocation
gesture is performed, the viewport is not reset to (0, 0) as stated in the summary. Instead, the point (0, 0) is centered.To Reproduce
OnBringIntoView
This PR fixes this behavior by changing the
PringIntoView
point to a nullable and use this info to decide if the ViewportSize shall be taken into account or not.