aboutsummaryrefslogtreecommitdiff
path: root/mod/src
diff options
context:
space:
mode:
Diffstat (limited to 'mod/src')
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/AbsXY.java3
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/popups/AbsLocationPopup.java3
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()
);