From bf0e16b8d6583a041ef998aed3e80ecdbe8e4d97 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 26 Aug 2019 18:43:55 +0200 Subject: [PATCH] ProgressBar: fixed right-to-left painting --- .../main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java index e220eb84..65a69da6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java @@ -93,7 +93,8 @@ public class FlatProgressBarUI g.setColor( progressBar.getForeground() ); ((Graphics2D)g).fill( horizontal - ? new RoundRectangle2D.Float( x, y, amountFull, height, arc, arc ) + ? new RoundRectangle2D.Float( c.getComponentOrientation().isLeftToRight() ? x : x + (width - amountFull), + y, amountFull, height, arc, arc ) : new RoundRectangle2D.Float( x, y + (height - amountFull), width, amountFull, arc, arc ) ); if( progressBar.isStringPainted() )