Skip to content

Commit

Permalink
Refactoring some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Oct 25, 2020
1 parent a4273e5 commit be33339
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/PdfiumViewer/ScrollPanel.Paning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ protected override void OnPreviewMouseUp(MouseButtonEventArgs e)

Cursor = Cursors.Arrow;
IsMouseDown = false;
var currentPoint = e.GetPosition(this);
// Determine the new amount to scroll.
_scrollTarget = GetScrollTarget(currentPoint);
InertiaHandleMouseUp();
}

Expand Down
11 changes: 7 additions & 4 deletions src/PdfiumViewer/ScrollPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
{
base.OnPreviewMouseWheel(e);

MouseWheelUpdateTime = Environment.TickCount64;
MouseWheelDelta = e.Delta;

SetMouseWheelDelta(e.Delta);

if (IsDocumentLoaded)
{
if (MouseWheelMode == MouseWheelMode.Zoom)
Expand Down Expand Up @@ -450,7 +449,11 @@ public void PerformScroll(ScrollAction action, Orientation scrollBar)
}
}
}

protected void SetMouseWheelDelta(int delta)
{
MouseWheelUpdateTime = Environment.TickCount64;
MouseWheelDelta = delta;
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
Expand Down

0 comments on commit be33339

Please sign in to comment.