From b98270bc0de3112734f04d24b093d387f3ebc36d Mon Sep 17 00:00:00 2001 From: Dar Date: Wed, 23 Oct 2024 15:43:08 +0200 Subject: [PATCH] fix: respect the selection arc --- .../src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java index 651466985..5933ae6e2 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java @@ -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; @@ -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