From a878703fdc8af7d787797ebb34ef6e904b105a32 Mon Sep 17 00:00:00 2001 From: Amin Bouzerda Date: Mon, 4 Dec 2023 21:35:36 +0100 Subject: [PATCH] Fixed hexagon view offset in stack pane. hexagon view is centered now. --- .../src/main/kotlin/tools/aqua/bgw/builder/HexagonBuilder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/HexagonBuilder.kt b/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/HexagonBuilder.kt index 6b525a30cc..a5a4371f8b 100644 --- a/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/HexagonBuilder.kt +++ b/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/HexagonBuilder.kt @@ -144,7 +144,7 @@ object HexagonBuilder { val points = mutableListOf() var angle = 90.0 repeat(HEXAGON_SIDES) { - val x = size * cos(Math.toRadians(angle)) + size / 2 * sqrt(3.0) + val x = size * cos(Math.toRadians(angle)) + size val y = size * sin(Math.toRadians(angle)) + size angle += FULL_CIRCLE_DEGREES / HEXAGON_SIDES points.add(x + offsetX.toDouble())