diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-27 11:53:57 -0500 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-27 11:53:57 -0500 |
| commit | b09f774d422263ce15b97d6d0804beddf856176d (patch) | |
| tree | e542258481d7496b15679f3c329ef9e087c7d8fc /src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java | |
| parent | 22cb02adbeb24b7ec98f843bcaba99cebe3e4f03 (diff) | |
| download | notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.gz notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.bz2 notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.zip | |
feat: improve formating :)
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.java | 104 |
1 files changed, 52 insertions, 52 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 3582a549..4540b146 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java @@ -8,56 +8,56 @@ import java.util.HashMap; import java.util.Map; public abstract class MBGuiGroup extends MBGuiElement { - public int width; - public int height; - protected HashMap<MBGuiElement, Vector2f> childrenPosition = new HashMap<>(); - - public MBGuiGroup() {} - - public abstract Collection<MBGuiElement> getChildren(); - - public Map<MBGuiElement, Vector2f> getChildrenPosition() { - return Collections.unmodifiableMap(childrenPosition); - } - - @Override - public int getWidth() { - return width; - } - - @Override - public int getHeight() { - return height; - } - - @Override - public void mouseClick(float x, float y, int mouseX, int mouseY) { - Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition(); - - for (MBGuiElement child : getChildren()) { - 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); - } - } - } - } - - @Override - public void mouseClickOutside() { - for (MBGuiElement child : getChildren()) { - child.mouseClickOutside(); - } - } - - @Override - public void render(float x, float y) { - Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition(); - - for (MBGuiElement child : getChildren()) { - Vector2f childPos = childrenPos.get(child); - child.render(x + childPos.x, y + childPos.y); - } - } + public int width; + public int height; + protected HashMap<MBGuiElement, Vector2f> childrenPosition = new HashMap<>(); + + public MBGuiGroup() {} + + public abstract Collection<MBGuiElement> getChildren(); + + public Map<MBGuiElement, Vector2f> getChildrenPosition() { + return Collections.unmodifiableMap(childrenPosition); + } + + @Override + public int getWidth() { + return width; + } + + @Override + public int getHeight() { + return height; + } + + @Override + public void mouseClick(float x, float y, int mouseX, int mouseY) { + Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition(); + + for (MBGuiElement child : getChildren()) { + 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); + } + } + } + } + + @Override + public void mouseClickOutside() { + for (MBGuiElement child : getChildren()) { + child.mouseClickOutside(); + } + } + + @Override + public void render(float x, float y) { + Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition(); + + for (MBGuiElement child : getChildren()) { + Vector2f childPos = childrenPos.get(child); + child.render(x + childPos.x, y + childPos.y); + } + } } |
