Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix border move indication for vehicles #4017

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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