From 876fdf88c580c51dc794188c71e12898e6616dd8 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Wed, 30 Dec 2020 14:12:27 +0900 Subject: use method, instead of field. using field direct is baaaaaad --- .../dungeonsguide/roomedit/elements/MLabelAndElement.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java index af3fe01d..9bab1bdb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java @@ -25,8 +25,8 @@ public class MLabelAndElement extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { - if (hover != null && new Rectangle(new Point(0,0),bounds.getSize()).contains(relMousex0, relMousey0)) { - Gui.drawRect(0,0,bounds.width, bounds.height, hover.getRGB()); + if (hover != null && new Rectangle(new Point(0,0),getBounds().getSize()).contains(relMousex0, relMousey0)) { + Gui.drawRect(0,0,getBounds().width, getBounds().height, hover.getRGB()); } } @@ -39,14 +39,14 @@ public class MLabelAndElement extends MPanel { @Override public void resize(int parentWidth, int parentHeight) { - this.setSize(new Dimension(parentWidth, bounds.height)); - label.setBounds(new Rectangle(0,0,parentHeight / 3, bounds.height)); - element.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, bounds.height)); + this.setSize(new Dimension(parentWidth, getBounds().height)); + label.setBounds(new Rectangle(0,0,parentHeight / 3, getBounds().height)); + element.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, getBounds().height)); } @Override public void onBoundsUpdate() { - label.setBounds(new Rectangle(0,0,bounds.width / 3, bounds.height)); - element.setBounds(new Rectangle(bounds.width / 3,0,bounds.width / 3 * 2, bounds.height)); + label.setBounds(new Rectangle(0,0,getBounds().width / 3, getBounds().height)); + element.setBounds(new Rectangle(getBounds().width / 3,0,getBounds().width / 3 * 2, getBounds().height)); } } -- cgit