Open Myrannas opened 5 years ago
Yes i think the Scrollpane speed is very very slow compare to Swing or any other app, i think its speed must be constant regardless how small or big the content height. I feel frustrated that i need to scroll like thousands times which in other app that has similar size can be scroll with only 2 scrolls.
Platform: OSX JavaFX Version: 12
Hi - I have noticed an interesting issue with the ScrollPane component. It looks like the scroll speed slows down when the content is almost the same size of the container. This is particularly apparent when the container is very large.
To reproduce create a scene similar to:
Resize the window to be only slightly larger than the content and scroll. The scroll speed should be very very slow.
I am pretty sure the problematic code is in: https://github.com/javafxports/openjdk-jfx/blob/develop/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ScrollPaneSkin.java#L896
In particular this modifies the scroll speed based on the total size of the container - but does not take into account the difference between the size of the viewport and the size of the container.
I think something similar to the following would give a more consistent scroll speed: