mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Avoid odd display when first opening image view
This commit is contained in:
@@ -367,6 +367,8 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
int groupX = PADDING;
|
int groupX = PADDING;
|
||||||
int itemAreaWidth = getVisibleSize().width;
|
int itemAreaWidth = getVisibleSize().width;
|
||||||
int groupWidth = itemAreaWidth - 2 * groupX;
|
int groupWidth = itemAreaWidth - 2 * groupX;
|
||||||
|
if (groupWidth <= 0) { return; }
|
||||||
|
|
||||||
int pileX = PADDING;
|
int pileX = PADDING;
|
||||||
int pileWidth = itemAreaWidth - 2 * pileX;
|
int pileWidth = itemAreaWidth - 2 * pileX;
|
||||||
|
|
||||||
@@ -786,6 +788,8 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void paintComponent(final Graphics g) {
|
public final void paintComponent(final Graphics g) {
|
||||||
|
if (groups.get(0).getBounds().height <= 0) { return; }
|
||||||
|
|
||||||
updateHoveredItem(hoverPoint, hoverScrollPos); //ensure hovered item up to date
|
updateHoveredItem(hoverPoint, hoverScrollPos); //ensure hovered item up to date
|
||||||
|
|
||||||
final Graphics2D g2d = (Graphics2D) g;
|
final Graphics2D g2d = (Graphics2D) g;
|
||||||
|
|||||||
Reference in New Issue
Block a user