Update image when cards in editor are resized

Currently images are blurred when changing GUI size in the editor,
and this fixes the issue.
This commit is contained in:
draxdyn 2016-06-01 20:36:26 +02:00
parent a9744b2d04
commit 5c177dcdc8

View file

@ -634,6 +634,11 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
@Override
public final void setCardBounds(int x, int y, int cardWidth, int cardHeight) {
if(cardWidth == this.cardWidth && cardHeight == this.cardHeight) {
setBounds(x - cardXOffset, y - cardYOffset, getWidth(), getHeight());
return;
}
this.cardWidth = cardWidth;
this.symbolWidth = cardWidth / 7;
this.cardHeight = cardHeight;
@ -656,6 +661,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
int height = cardYOffset * 2 + cardHeight;
setBounds(x - cardXOffset, y - cardYOffset, width, height);
}
if(imagePanel != null && imagePanel.getSrcImage() != null)
updateImage();
}
public int getXOffset(int cardWidth) {