mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Fixed MouseWheel handling
This commit is contained in:
parent
8e50ad9d8f
commit
1ab76446ba
2 changed files with 6 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// © 2020 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
|
|
@ -98,9 +99,9 @@ namespace MapControl
|
|||
|
||||
private void OnMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
var zoomDelta = MouseWheelZoomDelta * e.Delta / 120d;
|
||||
var zoomLevel = TargetZoomLevel + MouseWheelZoomDelta * Math.Sign(e.Delta);
|
||||
|
||||
ZoomMap(e.GetPosition(this), TargetZoomLevel + zoomDelta);
|
||||
ZoomMap(e.GetPosition(this), MouseWheelZoomDelta * Math.Round(zoomLevel / MouseWheelZoomDelta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue