From 9de5d0e3eb0bd748e693b94ba5fb0794ef02a8e4 Mon Sep 17 00:00:00 2001 From: mangofeet Date: Fri, 2 Dec 2022 10:55:25 -0700 Subject: [PATCH] fix border move indication for vehicles --- .../client/ui/swing/minimap/Minimap.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/megamek/src/megamek/client/ui/swing/minimap/Minimap.java b/megamek/src/megamek/client/ui/swing/minimap/Minimap.java index e576630a249..5f1abcea3f6 100644 --- a/megamek/src/megamek/client/ui/swing/minimap/Minimap.java +++ b/megamek/src/megamek/client/ui/swing/minimap/Minimap.java @@ -941,14 +941,12 @@ private void paintUnit(Graphics g, Entity entity) { Path2D form = MinimapUnitSymbols.getForm(entity); - Color borderColor = Color.WHITE; + Color borderColor = entity.moved != EntityMovementType.MOVE_NONE ? Color.BLACK : Color.WHITE; Color fontColor = Color.BLACK; - if (entity.moved != EntityMovementType.MOVE_NONE) { - borderColor = Color.BLACK; - } - + float outerBorderWidth = 30f; - float innerBorderWidth = 20f; + float innerBorderWidth = 10f; + float formStrokeWidth = 20f; if (stratOpsSymbols) { // White border to set off the icon from the background @@ -960,15 +958,12 @@ private void paintUnit(Graphics g, Entity entity) { g2.setColor(fontColor); g2.fill(STRAT_BASERECT); - // Rectangle border for all units - g2.setColor(borderColor); - g2.setStroke(new BasicStroke(innerBorderWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); - g2.draw(STRAT_BASERECT); - // Set a thin brush for filled areas (leave a thick brush for line symbols if ((entity instanceof Mech) || (entity instanceof Protomech) || (entity instanceof VTOL) || (entity.isAero())) { g2.setStroke(new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); + } else { + g2.setStroke(new BasicStroke(formStrokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); } // Fill the form in player color / team color @@ -1002,6 +997,11 @@ private void paintUnit(Graphics g, Entity entity) { // Draw the unit icon in black g2.draw(form); + // Rectangle border for all units + g2.setColor(borderColor); + g2.setStroke(new BasicStroke(innerBorderWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); + g2.draw(STRAT_BASERECT); + } else { // Standard symbols // White border to set off the icon from the background