From 5c177dcdc8fd70a6b29430d20dcd786b9f14b509 Mon Sep 17 00:00:00 2001 From: draxdyn Date: Wed, 1 Jun 2016 20:36:26 +0200 Subject: [PATCH] Update image when cards in editor are resized Currently images are blurred when changing GUI size in the editor, and this fixes the issue. --- .../src/main/java/org/mage/card/arcane/CardPanel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index 480249f9bf..bae5624725 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -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) {