Skip to content

Commit

Permalink
#4876 Fix Unit Display General tab rendered blank when switching units.
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneySkull committed Dec 2, 2023
1 parent 09b8c05 commit c3a6e45
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions megamek/src/megamek/client/ui/swing/MovementDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -751,15 +751,17 @@ public synchronized void selectEntity(int en) {
cen = en;
clientgui.setSelectedEntityNum(en);
gear = MovementDisplay.GEAR_LAND;
Color walkColor = GUIP.getMoveDefaultColor();
clientgui.getBoardView().setHighlightColor(walkColor);

// Issue:#4876 moving the call to 'displayEntity' before boardview calls that invoke 'repaint()'
// this seems to prevent blank general tab when switching units when the map is zoomed all the way out.
clientgui.getUnitDisplay().displayEntity(ce);
clientgui.getBoardView().setHighlightColor(GUIP.getMoveDefaultColor());
clear();

updateButtons();
clientgui.getBoardView().highlight(ce.getPosition());
clientgui.getBoardView().select(null);
clientgui.getBoardView().cursor(null);
clientgui.getUnitDisplay().displayEntity(ce);
clientgui.getUnitDisplay().showPanel("movement");
if (!clientgui.getBoardView().isMovingUnits()) {
clientgui.getBoardView().centerOnHex(ce.getPosition());
Expand Down

0 comments on commit c3a6e45

Please sign in to comment.