Skip to content

Commit

Permalink
ScrollBar: avoid continuous repainting scrollbar when moving mouse po…
Browse files Browse the repository at this point in the history
…inter over track and `ScrollBar.hoverThumbWithTrack` is enabled (regression in fd208a3)
  • Loading branch information
DevCharly committed Jun 17, 2020
1 parent 211030b commit 273d762
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -245,7 +245,7 @@ protected void paintThumb( Graphics g, JComponent c, Rectangle thumbBounds ) {
if( thumbBounds.isEmpty() || !scrollbar.isEnabled() )
return;

g.setColor( getThumbColor( c, hoverThumb ) );
g.setColor( getThumbColor( c, hoverThumb || (hoverThumbWithTrack && hoverTrack) ) );
paintTrackOrThumb( g, c, thumbBounds, thumbInsets, thumbArc );
}

Expand Down Expand Up @@ -336,7 +336,7 @@ private void update( int x, int y ) {
boolean inThumb = getThumbBounds().contains( x, y );
if( inTrack != hoverTrack || inThumb != hoverThumb ) {
hoverTrack = inTrack;
hoverThumb = inThumb || (hoverThumbWithTrack && inTrack);
hoverThumb = inThumb;
repaint();
}
}
Expand Down

0 comments on commit 273d762

Please sign in to comment.