diff --git a/forge-gui-mobile/src/forge/card/CardZoom.java b/forge-gui-mobile/src/forge/card/CardZoom.java index 7c3391f319f..cf1c81aa01c 100644 --- a/forge-gui-mobile/src/forge/card/CardZoom.java +++ b/forge-gui-mobile/src/forge/card/CardZoom.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment; import com.badlogic.gdx.math.Rectangle; @@ -220,11 +221,24 @@ public class CardZoom extends FOverlay { float maxCardHeight = h - 2 * messageHeight; float cardWidth, cardHeight, y; + if (oneCardView && !Forge.isLandscapeMode()) { + cardWidth = w; cardHeight = FCardPanel.ASPECT_RATIO * cardWidth; + + boolean rotateSplit = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_SPLIT_CARDS); + if (currentCard.isSplitCard() && rotateSplit) { + // card will be rotated. Make sure that the height does not exceed the width of the view + if (cardHeight > Gdx.graphics.getWidth()) + { + cardHeight = Gdx.graphics.getWidth(); + cardWidth = cardHeight / FCardPanel.ASPECT_RATIO; + } + } } else { + cardWidth = w * 0.5f; cardHeight = FCardPanel.ASPECT_RATIO * cardWidth; @@ -240,7 +254,7 @@ public class CardZoom extends FOverlay { if (nextCard != null) { CardImageRenderer.drawZoom(g, nextCard, gameView, false, w - cardWidth, y, cardWidth, cardHeight, getWidth(), getHeight(), false); } - + cardWidth = w * 0.7f; cardHeight = FCardPanel.ASPECT_RATIO * cardWidth; }