diff options
author | syeyoung <cyoung06@naver.com> | 2023-01-25 18:39:55 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-01-25 18:39:55 +0900 |
commit | 2c9e03a56995baba5953b5361eaca7c077ddcfca (patch) | |
tree | 44f0c2b851ce7c5f521d8834c31c5941034b2ce3 /mod/src/main | |
parent | 4566b88ac437323337bf1f8699766b007a931c4e (diff) | |
download | Skyblock-Dungeons-Guide-2c9e03a56995baba5953b5361eaca7c077ddcfca.tar.gz Skyblock-Dungeons-Guide-2c9e03a56995baba5953b5361eaca7c077ddcfca.tar.bz2 Skyblock-Dungeons-Guide-2c9e03a56995baba5953b5361eaca7c077ddcfca.zip |
- Fix ABSXY trying to set locaiton when size is not set
- Fix AbsLocationPopup using relativebound to determine scale
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main')
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java | 3 | ||||
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java index 75db0973..0f5a97d1 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java @@ -47,8 +47,9 @@ public class AbsXY extends AnnotatedExportOnlyWidget implements Layouter { } private void setLocations(double old, double neu) { - if (getDomElement().getChildren().size() <= 0) return; + if (getDomElement().getChildren().size() == 0) return; DomElement child = getDomElement().getChildren().get(0); + if (child.getSize() == null) return; child.setRelativeBound(new Rect(x.getValue(), y.getValue(), child.getSize().getWidth(), child.getSize().getHeight())); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java index 06db01e2..e9331b33 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java @@ -22,6 +22,7 @@ import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute; import kr.syeyoung.dungeonsguide.mod.guiv2.DomElement; import kr.syeyoung.dungeonsguide.mod.guiv2.Widget; import kr.syeyoung.dungeonsguide.mod.guiv2.primitive.Rect; +import kr.syeyoung.dungeonsguide.mod.guiv2.primitive.Size; import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedImportOnlyWidget; import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedWidget; import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.Bind; @@ -68,7 +69,7 @@ public class AbsLocationPopup extends AnnotatedImportOnlyWidget { public void updatePos(double old, double neu) { PopupMgr popupMgr = PopupMgr.getPopupMgr(getDomElement()); Rect rect = popupMgr.getDomElement().getAbsBounds(); - Rect rel = popupMgr.getDomElement().getRelativeBound(); + Size rel = popupMgr.getDomElement().getSize(); this.x.setValue( (absX.getValue() - rect.getX()) * rel.getWidth() / rect.getWidth() ); |