From 38228b5a36111f1b4e044e8bce7f4ca45321343d Mon Sep 17 00:00:00 2001 From: kevlahnota Date: Thu, 28 Sep 2017 01:52:09 +0000 Subject: [PATCH] Try to fix rotated split card with foil overlay git-svn-id: http://svn.slightlymagic.net/forge/trunk@35803 269b9781-a132-4a9b-9d4e-f004f1b56b58 --- forge-gui-mobile/src/forge/card/CardFaceSymbols.java | 11 +++++++++-- forge-gui-mobile/src/forge/card/CardRenderer.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/forge-gui-mobile/src/forge/card/CardFaceSymbols.java b/forge-gui-mobile/src/forge/card/CardFaceSymbols.java index 87025898..dcc8ac9b 100644 --- a/forge-gui-mobile/src/forge/card/CardFaceSymbols.java +++ b/forge-gui-mobile/src/forge/card/CardFaceSymbols.java @@ -17,6 +17,7 @@ */ package forge.card; +import com.badlogic.gdx.graphics.g2d.TextureRegion; import forge.Graphics; import forge.assets.FSkinImage; 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) { return; } @@ -163,7 +164,13 @@ public class CardFaceSymbols { BugReporter.reportBug("Symbol not recognized \"" + symbol + "\" in string: " + s); continue; } - g.drawImage(image, x, y, w, h); + + 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); + x += dx; } } diff --git a/forge-gui-mobile/src/forge/card/CardRenderer.java b/forge-gui-mobile/src/forge/card/CardRenderer.java index c67da0a8..9173eb71 100644 --- a/forge-gui-mobile/src/forge/card/CardRenderer.java +++ b/forge-gui-mobile/src/forge/card/CardRenderer.java @@ -668,7 +668,7 @@ public class CardRenderer { if (isPreferenceEnabled(FPref.UI_OVERLAY_FOIL_EFFECT) && MatchController.instance.mayView(card)) { int foil = card.getCurrentState().getFoilIndex(); 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()); } } }