mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
Fix scrolling to fast on a precision touchpad
This commit is contained in:
@@ -92,12 +92,18 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
|
||||
private void ViewPanel_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
|
||||
return;
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
var newZoom = _zoomFactor + e.Delta / 120 * 0.1;
|
||||
if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
|
||||
{
|
||||
// normal scroll
|
||||
viewPanel.ScrollToVerticalOffset(viewPanel.VerticalOffset - e.Delta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// zoom
|
||||
var newZoom = _zoomFactor + (double) e.Delta / 120 * 0.1;
|
||||
|
||||
newZoom = Math.Max(newZoom, _minZoomFactor);
|
||||
newZoom = Math.Min(newZoom, 3);
|
||||
|
Reference in New Issue
Block a user