mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Try to fix rotated split card with foil overlay
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
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;
|
x += dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user