In MechViewPanel.java:
Line 128 should be:
int width = DEFAULT_WIDTH;
instead of
int width = WIDTH;
Line 136 should be:
int height = DEFAULT_HEIGHT;
instead of
int height = HEIGHT;
DEFAULT_WIDTH and DEFAULT_HEIGHT are defined in MechViewPanel, WIDTH and HEIGHT are flags in java.awt.image.ImageObserver.
I spent some more time on this and have made a few more changes, which I have attached as a patch.
In a discussion with Xenon54z, he recommended ensuring that fluff images don't make the MechViewPanel get too large, so I decided to check to see if the fluff image is larger than DEFAULT_WIDTH, and if it is the image is scaled to be less than or equal to DEFAULT_WIDTH while preserving the aspect ratio.
While making this change, I made two other fixes. One, is that in
MechSelectorDialogthe unit table selection changed callback (MechSelectorDialogline 179) can fire more than once per selection change, which causes multiple calls torefreshUnitView. TheListSelectionEventhas a method,getValueIsAdjustingthat can be used to ensure that therefreshUnitViewis only called once each time the selection is changed.In addition, the
refreshUnitViewmethod withinMechSelectorDialogis a bit inefficient. It creates aMechViewobject just to check whether it can be created with the selectedEntity, and if it can be created, it updates theMechViewPanelwhich creates anotherMechView. By adding a newsetMech(Entity, MechView)method toMechViewDialogonly oneMechViewneeds to be created.fixed, thanks