Skip to content

Commit

Permalink
Merge pull request #4017 from mangofeet/master
Browse files Browse the repository at this point in the history
Fix border move indication for vehicles
  • Loading branch information
Windchild292 authored Dec 8, 2022
2 parents 9dfeaf2 + 9de5d0e commit 6f79b1c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions megamek/src/megamek/client/ui/swing/minimap/Minimap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f79b1c

Please sign in to comment.