Avoid odd display when first opening image view

This commit is contained in:
drdev
2014-02-07 03:51:17 +00:00
parent 54b86b4db2
commit ae23652c0c

View File

@@ -367,6 +367,8 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
int groupX = PADDING;
int itemAreaWidth = getVisibleSize().width;
int groupWidth = itemAreaWidth - 2 * groupX;
if (groupWidth <= 0) { return; }
int pileX = PADDING;
int pileWidth = itemAreaWidth - 2 * pileX;
@@ -786,6 +788,8 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
@Override
public final void paintComponent(final Graphics g) {
if (groups.get(0).getBounds().height <= 0) { return; }
updateHoveredItem(hoverPoint, hoverScrollPos); //ensure hovered item up to date
final Graphics2D g2d = (Graphics2D) g;