Fixed ItemZoom incompatibility in Grid. Fixes #1844

This commit is contained in:
raoulvdberge
2018-07-15 18:22:59 +02:00
parent bc5fb1f58b
commit e766e8a7c8
2 changed files with 13 additions and 5 deletions

View File

@@ -218,7 +218,7 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
}
}
public boolean isOverSlotWithStack() {
private boolean isOverSlotWithStack() {
return grid.isActive() && isOverSlot() && slotNumber < view.getStacks().size();
}
@@ -310,6 +310,17 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
}
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
// Drawn in here for bug #1844 (https://github.com/raoulvdberge/refinedstorage/issues/1844)
// Item tooltips can't be rendered in the foreground layer due to the X offset translation.
if (isOverSlotWithStack()) {
drawGridTooltip(view.getStacks().get(slotNumber), mouseX, mouseY);
}
}
@Override
public void drawForeground(int mouseX, int mouseY) {
drawString(7, 7 + tabs.getHeight(), t(grid.getGuiTitle()));
@@ -357,10 +368,6 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
}
}
if (isOverSlotWithStack()) {
drawGridTooltip(view.getStacks().get(slotNumber), mouseX, mouseY);
}
if (isOverClear(mouseX, mouseY)) {
drawTooltip(mouseX, mouseY, t("misc.refinedstorage:clear"));
}