Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ToolWindow zoom when in Pan mode #41

Merged
merged 2 commits into from Feb 16, 2017

Conversation

AleksandarDev
Copy link
Contributor

Fixed the issue when using ZoomWindow in Pan mode
Issue #36

The issue is that, when the ActiveTool is Pan but we decided to apply ToolWindow zoom transform (because Shift modifier is active), _dragEndPoint was not set in MouseMove method (because we are in Pan mode).

To fix the problem, mouse event positions e.X, e.Y are used as end point (like in other tools) when mouse click is released.

Do not merge this pull request before #40 because it contains both changes
(my bad, previous PR was on master branch instead of a new branch)

@AleksandarDev
Copy link
Contributor Author

AleksandarDev commented Dec 7, 2016

The new line (as in PR)

var zoomWindowEndPoint = new PointF(e.X, e.Y);

Could be (as _dragEndPoint is not zero when in active tool is ZoomWindow)

var zoomWindowEndPoint = _activeTool == Tools.ZoomWindow ? _dragEndPoint : new PointF(e.X, e.Y);

But I tested both cases (Pan and ToolWindow as active tools) and they behave as expected - same. So the first option should be good enough.

@FObermaier FObermaier merged commit 77cd6b3 into SharpMap:Branches/1.0 Feb 16, 2017
@AleksandarDev AleksandarDev deleted the shiftzoom-fix branch June 28, 2017 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants