From 2aad30193891c69707650ca4e59ff076a57f8fb9 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 7 Jun 2020 18:27:55 +0200 Subject: [PATCH] Spinner: fixed arrow positions --- .../java/com/formdev/flatlaf/ui/FlatArrowButton.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java index 6627edb9..5cd440de 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java @@ -160,14 +160,8 @@ public class FlatArrowButton rh++; } - // Adding -/+0.35 before rounding tends move up NORTH arrows and move down SOUTH arrows. - // This makes top margin of NORTH arrow equal to bottom margin of SOUTH arrow. - float rd = 0.35f; - float xrd = vert ? 0 : (direction == WEST ? -rd : rd); - float yrd = vert ? (direction == NORTH ? -rd : rd) : 0; - - int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) + xrd ); - int y = Math.round( (height - rh) / 2f + scale( (float) yOffset ) + yrd ); + int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) ); + int y = Math.round( (height - rh) / 2f + scale( (float) yOffset ) ); // move arrow for round borders Container parent = getParent();