ScrollBar: avoid continuous repainting scrollbar when moving mouse pointer over track and ScrollBar.hoverThumbWithTrack is enabled (regression in fd208a3879)

This commit is contained in:
Karl Tauber
2020-06-17 23:53:06 +02:00
parent 211030b5b6
commit 273d762cd3

View File

@@ -245,7 +245,7 @@ public class FlatScrollBarUI
if( thumbBounds.isEmpty() || !scrollbar.isEnabled() )
return;
g.setColor( getThumbColor( c, hoverThumb ) );
g.setColor( getThumbColor( c, hoverThumb || (hoverThumbWithTrack && hoverTrack) ) );
paintTrackOrThumb( g, c, thumbBounds, thumbInsets, thumbArc );
}
@@ -336,7 +336,7 @@ public class FlatScrollBarUI
boolean inThumb = getThumbBounds().contains( x, y );
if( inTrack != hoverTrack || inThumb != hoverThumb ) {
hoverTrack = inTrack;
hoverThumb = inThumb || (hoverThumbWithTrack && inTrack);
hoverThumb = inThumb;
repaint();
}
}