mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Added an exception for MPS_AKH when visualizing the card border (these cards do not have an actual black border around the card frame, it seems). The way it's currently handled in Forge, there's only a 2px border added around the card, which is necessarily to properly visualize the card selection box and stuff without making it glitch out. So, this is as close to black-borderless as I think can be without introducing visual artifacts.
This commit is contained in:
@@ -1095,7 +1095,14 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
Rectangle bounds = itemInfo.getBounds();
|
Rectangle bounds = itemInfo.getBounds();
|
||||||
final int itemWidth = bounds.width;
|
final int itemWidth = bounds.width;
|
||||||
final int selBorderSize = 1;
|
final int selBorderSize = 1;
|
||||||
final int borderSize = Math.round(itemWidth * CardPanel.BLACK_BORDER_SIZE);
|
|
||||||
|
// Unusual border exceptions
|
||||||
|
boolean noExtraBorder = false;
|
||||||
|
if (itemInfo.item instanceof IPaperCard) {
|
||||||
|
noExtraBorder = CardView.getCardForUi((IPaperCard)itemInfo.item).getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH");
|
||||||
|
}
|
||||||
|
|
||||||
|
final int borderSize = noExtraBorder? 2 : Math.round(itemWidth * CardPanel.BLACK_BORDER_SIZE);
|
||||||
final int cornerSize = Math.max(4, Math.round(itemWidth * CardPanel.ROUNDED_CORNER_SIZE));
|
final int cornerSize = Math.max(4, Math.round(itemWidth * CardPanel.ROUNDED_CORNER_SIZE));
|
||||||
|
|
||||||
if (itemInfo.selected || itemInfo == hoveredItem) {
|
if (itemInfo.selected || itemInfo == hoveredItem) {
|
||||||
|
|||||||
@@ -303,7 +303,9 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void doLayout() {
|
public final void doLayout() {
|
||||||
final int borderSize = Math.round(cardWidth * CardPanel.BLACK_BORDER_SIZE);
|
boolean noBorder = getCard().getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH"); // Unusual border exception
|
||||||
|
|
||||||
|
final int borderSize = noBorder ? 2 : Math.round(cardWidth * CardPanel.BLACK_BORDER_SIZE);
|
||||||
|
|
||||||
final Point imgPos = new Point(cardXOffset + borderSize, cardYOffset + borderSize);
|
final Point imgPos = new Point(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||||
final Dimension imgSize = new Dimension(cardWidth - (borderSize * 2), cardHeight - (borderSize * 2));
|
final Dimension imgSize = new Dimension(cardWidth - (borderSize * 2), cardHeight - (borderSize * 2));
|
||||||
|
|||||||
Reference in New Issue
Block a user