mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fix a possible IllegalArgumentException.
- Hotfix for foil cards: always use foil index '1' rather than a random foil (prevents flickering in deck editor).
This commit is contained in:
@@ -1102,7 +1102,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
if (paperCard.isFoil()) {
|
if (paperCard.isFoil()) {
|
||||||
final CardView card = ViewUtil.getCardForUi(paperCard);
|
final CardView card = ViewUtil.getCardForUi(paperCard);
|
||||||
if (card.getOriginal().getFoilIndex() == 0) { //if foil finish not yet established, assign a random one
|
if (card.getOriginal().getFoilIndex() == 0) { //if foil finish not yet established, assign a random one
|
||||||
card.getOriginal().setRandomFoil();
|
card.getOriginal().setFoilIndex(1); // FIXME should assign a random foil here
|
||||||
}
|
}
|
||||||
CardPanel.drawFoilEffect(g, card, bounds.x, bounds.y, bounds.width, bounds.height, borderSize);
|
CardPanel.drawFoilEffect(g, card, bounds.x, bounds.y, bounds.width, bounds.height, borderSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public enum CPicture implements ICDoc {
|
|||||||
final IPaperCard paperCard = ((IPaperCard)item);
|
final IPaperCard paperCard = ((IPaperCard)item);
|
||||||
final CardView c = ViewUtil.getCardForUi(paperCard);
|
final CardView c = ViewUtil.getCardForUi(paperCard);
|
||||||
if (paperCard.isFoil() && c.getOriginal().getFoilIndex() == 0) {
|
if (paperCard.isFoil() && c.getOriginal().getFoilIndex() == 0) {
|
||||||
c.getOriginal().setRandomFoil();
|
c.getOriginal().setFoilIndex(1); // FIXME should assign random foil here
|
||||||
}
|
}
|
||||||
showCard(c, false);
|
showCard(c, false);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
package forge.view.arcane.util;
|
package forge.view.arcane.util;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.font.FontRenderContext;
|
import java.awt.font.FontRenderContext;
|
||||||
import java.awt.font.LineBreakMeasurer;
|
import java.awt.font.LineBreakMeasurer;
|
||||||
@@ -121,8 +124,11 @@ public class OutlinedLabel extends JLabel {
|
|||||||
int textX = outlineSize, textY = 0;
|
int textX = outlineSize, textY = 0;
|
||||||
int wrapWidth = Math.max(0, wrap ? size.width - outlineSize * 2 : Integer.MAX_VALUE);
|
int wrapWidth = Math.max(0, wrap ? size.width - outlineSize * 2 : Integer.MAX_VALUE);
|
||||||
|
|
||||||
AttributedString attributedString = new AttributedString(getText());
|
final String text = getText();
|
||||||
attributedString.addAttribute(TextAttribute.FONT, getFont());
|
AttributedString attributedString = new AttributedString(text);
|
||||||
|
if (!StringUtils.isEmpty(text)) {
|
||||||
|
attributedString.addAttribute(TextAttribute.FONT, getFont());
|
||||||
|
}
|
||||||
AttributedCharacterIterator charIterator = attributedString.getIterator();
|
AttributedCharacterIterator charIterator = attributedString.getIterator();
|
||||||
FontRenderContext fontContext = g2d.getFontRenderContext();
|
FontRenderContext fontContext = g2d.getFontRenderContext();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user