mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Merge pull request #2027 from draxdyn/resize_editor
Update image when cards in editor are resized
This commit is contained in:
commit
c505c2f44f
1 changed files with 7 additions and 0 deletions
|
@ -634,6 +634,11 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void setCardBounds(int x, int y, int cardWidth, int cardHeight) {
|
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.cardWidth = cardWidth;
|
||||||
this.symbolWidth = cardWidth / 7;
|
this.symbolWidth = cardWidth / 7;
|
||||||
this.cardHeight = cardHeight;
|
this.cardHeight = cardHeight;
|
||||||
|
@ -656,6 +661,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
int height = cardYOffset * 2 + cardHeight;
|
int height = cardYOffset * 2 + cardHeight;
|
||||||
setBounds(x - cardXOffset, y - cardYOffset, width, height);
|
setBounds(x - cardXOffset, y - cardYOffset, width, height);
|
||||||
}
|
}
|
||||||
|
if(imagePanel != null && imagePanel.getSrcImage() != null)
|
||||||
|
updateImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getXOffset(int cardWidth) {
|
public int getXOffset(int cardWidth) {
|
||||||
|
|
Loading…
Reference in a new issue