diff options
author | syeyoung <cyong06@naver.com> | 2020-12-30 14:12:27 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2020-12-30 14:12:27 +0900 |
commit | 876fdf88c580c51dc794188c71e12898e6616dd8 (patch) | |
tree | bf25e93f6f95507fd90aacc133f0fd8be801634a /src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java | |
parent | 00c92d34b5373441f798da15341d5606693be684 (diff) | |
download | Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.tar.gz Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.tar.bz2 Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.zip |
use method, instead of field.
using field direct is baaaaaad
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java | 14 |
1 files changed, 7 insertions, 7 deletions
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)); } } |