diff options
author | syeyoung <cyong06@naver.com> | 2021-07-21 15:29:43 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-07-21 15:29:43 +0900 |
commit | d392b203a93a8897a184f75634338b7c866510f3 (patch) | |
tree | a27505fbdc2bc754c674a026915c27065984c00e /src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java | |
parent | 4850d1a1f795f625286b9a2058143f688265dc3d (diff) | |
download | Skyblock-Dungeons-Guide-d392b203a93a8897a184f75634338b7c866510f3.tar.gz Skyblock-Dungeons-Guide-d392b203a93a8897a184f75634338b7c866510f3.tar.bz2 Skyblock-Dungeons-Guide-d392b203a93a8897a184f75634338b7c866510f3.zip |
custom party finder
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java index af29f92a..a90e40e5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java @@ -34,6 +34,9 @@ public class MPassiveLabelAndElement extends MPanel { @Getter @Setter private Runnable onClick; + @Getter @Setter + private double divideRatio = 1/3.0; + public MPassiveLabelAndElement(String label, MPanel element) { this.add(this.label = new MLabel()); this.label.setText(label); @@ -62,7 +65,7 @@ public class MPassiveLabelAndElement extends MPanel { @Override public void onBoundsUpdate() { - 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)); + label.setBounds(new Rectangle(0,0, (int) (getBounds().width * divideRatio), getBounds().height)); + element.setBounds(new Rectangle((int) (getBounds().width * divideRatio),0, (int) (getBounds().width * (1-divideRatio)), getBounds().height)); } } |