Skip to content

Commit

Permalink
Fix: smooth scrolling was inactive after certain drag operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrriis committed Jul 31, 2023
1 parent 3f7e12e commit 6bb3878
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ public void eventDispatched( AWTEvent event ) {
if( Animator.useAnimation() && FlatSystemProperties.getBoolean( FlatSystemProperties.SMOOTH_SCROLLING, true ) ) {
boolean isHoldingScrollModeBlocked = false;
switch(event.getID()) {
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
if(isBlitScrollModeBlocked) {
int modifiersEx = ((MouseEvent)event).getModifiersEx();
if((modifiersEx & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK)) == 0) {
// If the scroll mode was blocked for dragging, let's release if we receive a non-drag-related event (i.e. drag is done).
for( JViewport viewport: viewportSet ) {
setBlitScrollModeBlocked( viewport, false );
setInSmoothScrolling( viewport, false );
}
isBlitScrollModeBlocked = false;
}
}
break;
case MouseEvent.MOUSE_PRESSED:
case MouseEvent.MOUSE_DRAGGED:
isHoldingScrollModeBlocked = true;
Expand Down

0 comments on commit 6bb3878

Please sign in to comment.