mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
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:
parent
a9744b2d04
commit
5c177dcdc8
1 changed files with 7 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue