Skip to content

Commit 77cd6b3

Browse files
authored
Merge pull request #41 from Enterwell/shiftzoom-fix
Fixed ToolWindow zoom when in Pan mode
2 parents 7f1c0d8 + 1928671 commit 77cd6b3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

SharpMap.UI/Forms/MapBox.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,10 +2256,17 @@ protected override void OnMouseUp(MouseEventArgs e)
22562256
{
22572257
if (_rectangle.Width > 0 && _rectangle.Height > 0)
22582258
{
2259+
var zoomWindowStartPoint = _dragStartPoint;
2260+
var zoomWindowEndPoint = new PointF(e.X, e.Y);
2261+
22592262
Coordinate lowerLeft;
22602263
Coordinate upperRight;
2261-
GetBounds(_map.ImageToWorld(_dragStartPoint), _map.ImageToWorld(_dragEndPoint),
2262-
out lowerLeft, out upperRight);
2264+
GetBounds(
2265+
_map.ImageToWorld(zoomWindowStartPoint),
2266+
_map.ImageToWorld(zoomWindowEndPoint),
2267+
out lowerLeft,
2268+
out upperRight);
2269+
22632270
_dragEndPoint.X = 0;
22642271
_dragEndPoint.Y = 0;
22652272

0 commit comments

Comments
 (0)