From e000b5cda5adc5d8d7c572b434bb514b1d4d4636 Mon Sep 17 00:00:00 2001 From: Jerome Berclaz Date: Tue, 16 Jul 2024 09:00:15 -0700 Subject: [PATCH] fixed left and right players name display (#34) --- src/main/java/com/leflat/jass/client/ModernGamePanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/leflat/jass/client/ModernGamePanel.java b/src/main/java/com/leflat/jass/client/ModernGamePanel.java index effacd6..0343035 100644 --- a/src/main/java/com/leflat/jass/client/ModernGamePanel.java +++ b/src/main/java/com/leflat/jass/client/ModernGamePanel.java @@ -626,7 +626,7 @@ void paintLeftArea(Graphics2D g2, Rectangle2D.Float leftArea, Dimension cardDime // name float nameX = leftArea.x + leftArea.width * 20f / 120f; - float nameY = leftArea.y + min(leftArea.height * 90f / 450f, hand_y_offset - cardDimension.width / 3f); + float nameY = min(hand_y_offset - cardDimension.height / 10f, leftArea.y + leftArea.height / 4); g2.drawString(player.getName(), nameX, nameY); if (atoutChooser == PlayerPosition.LEFT) { g2.fillOval(round(nameX), round(nameY + 7), DOT_SIZE, DOT_SIZE); @@ -654,7 +654,7 @@ void paintRightArea(Graphics2D g2, Rectangle2D.Float rightArea, Dimension cardDi // name float nameX = rightArea.x + rightArea.width * 20f / 120f; - float nameY = rightArea.y + min(round(rightArea.height * 90f / 450f), hand_y_offset - cardDimension.width / 3f); + float nameY = min(hand_y_offset - cardDimension.height / 10f, rightArea.y + rightArea.height / 4); g2.drawString(player.getName(), nameX, nameY); if (atoutChooser == PlayerPosition.RIGHT) {