From d392b203a93a8897a184f75634338b7c866510f3 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Wed, 21 Jul 2021 15:29:43 +0900 Subject: custom party finder --- .../dungeonsguide/gui/elements/MPassiveLabelAndElement.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java') 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)); } } -- cgit