mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
Slider: snap to ticks is now done while dragging the thumb
This commit is contained in:
@@ -543,8 +543,8 @@ debug*/
|
||||
// move the mouse event coordinates back to current mouse location
|
||||
e.translatePoint( -tx, -ty );
|
||||
|
||||
// invoke super mouseDragged() to update thumb location
|
||||
super.mouseDragged( e );
|
||||
// invoke mouseDragged() to update thumb location
|
||||
mouseDragged( e );
|
||||
|
||||
setThumbPressed( true );
|
||||
}
|
||||
@@ -555,6 +555,20 @@ debug*/
|
||||
super.mouseReleased( e );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged( MouseEvent e ) {
|
||||
super.mouseDragged( e );
|
||||
|
||||
if( isDragging() &&
|
||||
slider.getSnapToTicks() &&
|
||||
slider.isEnabled() &&
|
||||
!UIManager.getBoolean( "Slider.snapToTicksOnReleased" ) )
|
||||
{
|
||||
calculateThumbLocation();
|
||||
slider.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
protected void setThumbHover( boolean hover ) {
|
||||
if( hover != thumbHover ) {
|
||||
thumbHover = hover;
|
||||
|
||||
Reference in New Issue
Block a user