aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-07-21 15:29:43 +0900
committersyeyoung <cyong06@naver.com>2021-07-21 15:29:43 +0900
commitd392b203a93a8897a184f75634338b7c866510f3 (patch)
treea27505fbdc2bc754c674a026915c27065984c00e /src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java
parent4850d1a1f795f625286b9a2058143f688265dc3d (diff)
downloadSkyblock-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-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java7
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));
}
}