Try to fix rotated split card with foil overlay

git-svn-id: http://svn.slightlymagic.net/forge/trunk@35803 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
kevlahnota 2017-09-28 01:52:09 +00:00
parent e05a8a0f8f
commit 38228b5a36
2 changed files with 10 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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());
}
}
}