TextComponents: fixed too fast scrolling in multi-line text components when using touchpads (e.g. on macOS) (issue #892)

This commit is contained in:
Karl Tauber
2024-10-11 19:18:00 +02:00
parent 3391f971ec
commit b304d46f7e
2 changed files with 3 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ FlatLaf Change Log
using custom component that overrides `Component.contains(int x, int y)` and using custom component that overrides `Component.contains(int x, int y)` and
invokes `SwingUtilities.convertPoint()` (or similar) from the overridden invokes `SwingUtilities.convertPoint()` (or similar) from the overridden
method. (issue #878) method. (issue #878)
- TextComponents: Fixed too fast scrolling in multi-line text components when
using touchpads (e.g. on macOS). (issue #892)
- ToolBar: Fixed endless loop if button in Toolbar has focus and is made - ToolBar: Fixed endless loop if button in Toolbar has focus and is made
invisible. (issue #884) invisible. (issue #884)

View File

@@ -210,7 +210,7 @@ public class FlatScrollPaneUI
// Use (0, 0) view position to obtain a constant unit increment of first item. // Use (0, 0) view position to obtain a constant unit increment of first item.
// Unit increment may be different for each item. // Unit increment may be different for each item.
Rectangle visibleRect = new Rectangle( viewport.getViewSize() ); Rectangle visibleRect = new Rectangle( viewport.getExtentSize() );
unitIncrement = scrollable.getScrollableUnitIncrement( visibleRect, orientation, 1 ); unitIncrement = scrollable.getScrollableUnitIncrement( visibleRect, orientation, 1 );
if( unitIncrement > 0 ) { if( unitIncrement > 0 ) {