Skip to content

Fixed ToolWindow zoom when in Pan mode#41

Merged
FObermaier merged 2 commits into
SharpMap:Branches/1.0from
Enterwell:shiftzoom-fix
Feb 16, 2017
Merged

Fixed ToolWindow zoom when in Pan mode#41
FObermaier merged 2 commits into
SharpMap:Branches/1.0from
Enterwell:shiftzoom-fix

Conversation

@AleksandarDev

Copy link
Copy Markdown
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

AleksandarDev commented Dec 7, 2016

Copy link
Copy Markdown
Contributor Author

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.

2 participants