Try to fix rotated split card with foil overlay

This commit is contained in:
kevlahnota
2017-09-28 01:52:09 +00:00
parent 58a5d9b0e1
commit 8ea99648f0
2 changed files with 10 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
*/ */
package forge.card; package forge.card;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import forge.Graphics; import forge.Graphics;
import forge.assets.FSkinImage; import forge.assets.FSkinImage;
import forge.card.mana.ManaCost; import forge.card.mana.ManaCost;
@@ -148,7 +149,7 @@ public class CardFaceSymbols {
} }
} }
public static void drawOther(final Graphics g, String s, float x, final float y, final float w, final float h) { public static void drawOther(final Graphics g, String s, float x, final float y, final float w, final float h, boolean rotate) {
if (s.length() == 0) { if (s.length() == 0) {
return; return;
} }
@@ -163,7 +164,13 @@ public class CardFaceSymbols {
BugReporter.reportBug("Symbol not recognized \"" + symbol + "\" in string: " + s); BugReporter.reportBug("Symbol not recognized \"" + symbol + "\" in string: " + s);
continue; continue;
} }
if(rotate) {
g.drawRotatedImage(image.getTextureRegion(), x, y, w, h, x+w /2, y+h /2,90);
}
else
g.drawImage(image, x, y, w, h); g.drawImage(image, x, y, w, h);
x += dx; x += dx;
} }
} }

View File

@@ -668,7 +668,7 @@ public class CardRenderer {
if (isPreferenceEnabled(FPref.UI_OVERLAY_FOIL_EFFECT) && MatchController.instance.mayView(card)) { if (isPreferenceEnabled(FPref.UI_OVERLAY_FOIL_EFFECT) && MatchController.instance.mayView(card)) {
int foil = card.getCurrentState().getFoilIndex(); int foil = card.getCurrentState().getFoilIndex();
if (foil > 0) { if (foil > 0) {
CardFaceSymbols.drawOther(g, String.format("foil%02d", foil), x, y, w, h); CardFaceSymbols.drawOther(g, String.format("foil%02d", foil), x, y, w, h, card.isSplitCard());
} }
} }
} }