mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Fixed a problem with index out of bound for card renderer.
This commit is contained in:
parent
0d46c68924
commit
8cf6a97616
1 changed files with 21 additions and 19 deletions
|
@ -5,19 +5,6 @@
|
|||
*/
|
||||
package org.mage.card.arcane;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.cards.ArtRect;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.MageObjectType;
|
||||
import mage.constants.SubType;
|
||||
import mage.util.SubTypeList;
|
||||
import mage.view.CardView;
|
||||
import mage.view.PermanentView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.font.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
@ -31,6 +18,18 @@ import java.text.CharacterIterator;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import javax.swing.*;
|
||||
import mage.ObjectColor;
|
||||
import mage.cards.ArtRect;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.MageObjectType;
|
||||
import mage.constants.SubType;
|
||||
import mage.util.SubTypeList;
|
||||
import mage.view.CardView;
|
||||
import mage.view.PermanentView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -849,6 +848,9 @@ public class ModernCardRenderer extends CardRenderer {
|
|||
inset = cardWidth / 12;
|
||||
}
|
||||
int availWidth = w - inset;
|
||||
if (availWidth < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
FontRenderContext frc = g.getFontRenderContext();
|
||||
AttributedCharacterIterator textIter = text.getIterator();
|
||||
|
|
Loading…
Reference in a new issue