File tree Expand file tree Collapse file tree
flatlaf-core/src/main/java/com/formdev/flatlaf Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,21 @@ public void eventDispatched( AWTEvent event ) {
6060 if ( Animator .useAnimation () && FlatSystemProperties .getBoolean ( FlatSystemProperties .SMOOTH_SCROLLING , true ) ) {
6161 boolean isHoldingScrollModeBlocked = false ;
6262 switch (event .getID ()) {
63+ case MouseEvent .MOUSE_MOVED :
64+ case MouseEvent .MOUSE_ENTERED :
65+ case MouseEvent .MOUSE_EXITED :
66+ if (isBlitScrollModeBlocked ) {
67+ int modifiersEx = ((MouseEvent )event ).getModifiersEx ();
68+ if ((modifiersEx & (MouseEvent .BUTTON1_DOWN_MASK | MouseEvent .BUTTON2_DOWN_MASK | MouseEvent .BUTTON3_DOWN_MASK )) == 0 ) {
69+ // If the scroll mode was blocked for dragging, let's release if we receive a non-drag-related event (i.e. drag is done).
70+ for ( JViewport viewport : viewportSet ) {
71+ setBlitScrollModeBlocked ( viewport , false );
72+ setInSmoothScrolling ( viewport , false );
73+ }
74+ isBlitScrollModeBlocked = false ;
75+ }
76+ }
77+ break ;
6378 case MouseEvent .MOUSE_PRESSED :
6479 case MouseEvent .MOUSE_DRAGGED :
6580 isHoldingScrollModeBlocked = true ;
You can’t perform that action at this time.
0 commit comments