aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
index aba1d743..86ff7278 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
@@ -35,8 +35,10 @@ public abstract class MBGuiGroup extends MBGuiElement {
@Override
public void mouseClick(float x, float y, int mouseX, int mouseY) {
+ Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition();
+
for(MBGuiElement child : getChildren()) {
- Vector2f childPos = childrenPosition.get(child);
+ Vector2f childPos = childrenPos.get(child);
if(mouseX > x+childPos.x && mouseX < x+childPos.x+child.getWidth()) {
if(mouseY > y+childPos.y && mouseY < y+childPos.y+child.getHeight()) {
child.mouseClick(x+childPos.x, y+childPos.y, mouseX, mouseY);