Skip to content

Commit

Permalink
fix: respect the selection arc
Browse files Browse the repository at this point in the history
  • Loading branch information
dar-dev committed Oct 23, 2024
1 parent b5ed67f commit b98270b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public class FlatTreeUI
@Styleable protected Color selectionInactiveBackground;
@Styleable protected Color selectionInactiveForeground;
@Styleable protected Color selectionBorderColor;
@Styleable protected Color alternateRowColor;
/** @since 3.6 */ @Styleable protected Color alternateRowColor;
/** @since 3 */ @Styleable protected Insets selectionInsets;
/** @since 3 */ @Styleable protected int selectionArc;
@Styleable protected boolean wideSelection;
Expand Down Expand Up @@ -577,7 +577,11 @@ protected void paintRow( Graphics g, Rectangle clipBounds, Insets insets, Rectan

if( alternateRowColor != null && row % 2 != 0 ) {
g.setColor( alternateRowColor );
FlatUIUtils.paintComponentBackground((Graphics2D) g, 0, bounds.y, tree.getWidth(), bounds.height, 0, 0);

// paint respecting selection arc
final float arc = UIScale.scale( selectionArc / 2f );
FlatUIUtils.paintSelection( (Graphics2D) g, 0, bounds.y, tree.getWidth(), bounds.height,
UIScale.scale( selectionInsets ), arc, arc, arc, arc, 0 );
}

// do not paint row if editing
Expand Down

0 comments on commit b98270b

Please sign in to comment.