aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/layout')
-rw-r--r--src/main/model/layout/BlockLayout.java1
-rw-r--r--src/main/model/layout/FlexLayout.java1
-rw-r--r--src/main/model/layout/Layout.java1
3 files changed, 2 insertions, 1 deletions
diff --git a/src/main/model/layout/BlockLayout.java b/src/main/model/layout/BlockLayout.java
index 8808d80..c2ec40d 100644
--- a/src/main/model/layout/BlockLayout.java
+++ b/src/main/model/layout/BlockLayout.java
@@ -15,6 +15,7 @@ public class BlockLayout extends Layout {
this.getPreviousSibling().ifPresent(
sibling -> this.setY(sibling.getY() + sibling.getHeight()));
+
this.setDimension(this.getParent().getDimension());
for (Layout child : this.getChildren()) {
diff --git a/src/main/model/layout/FlexLayout.java b/src/main/model/layout/FlexLayout.java
index 389e8d0..7b1e759 100644
--- a/src/main/model/layout/FlexLayout.java
+++ b/src/main/model/layout/FlexLayout.java
@@ -12,6 +12,5 @@ public class FlexLayout extends Layout {
// todo: we'll cheese it, and treat it like a sideways block
public void layout() {
-
}
}
diff --git a/src/main/model/layout/Layout.java b/src/main/model/layout/Layout.java
index ba9f604..f9ef70e 100644
--- a/src/main/model/layout/Layout.java
+++ b/src/main/model/layout/Layout.java
@@ -72,6 +72,7 @@ public abstract class Layout {
public static DocumentLayout constructTree(ArrayList<Node> html) {
DocumentLayout result = new DocumentLayout();
result.setChildren(constructTree(html, result));
+ result.layout();
return result;
}