diff --git a/common/src/app/common/geom/shapes/flex_layout/bounds.cljc b/common/src/app/common/geom/shapes/flex_layout/bounds.cljc index 31f0317a1..d4fff31a7 100644 --- a/common/src/app/common/geom/shapes/flex_layout/bounds.cljc +++ b/common/src/app/common/geom/shapes/flex_layout/bounds.cljc @@ -28,6 +28,8 @@ h-center? (ctl/h-center? parent) h-end? (ctl/h-end? parent) + around? (ctl/space-around? parent) + between? (ctl/space-between? parent) fill-w? (ctl/fill-width? child) fill-h? (ctl/fill-height? child) @@ -64,8 +66,11 @@ min-width (max min-width 0.01) min-height (max min-height 0.01)] - (cond-> [base-p] - (or col? h-start?) + (cond-> [base-p + (gpt/add base-p (hv 0.01)) + (gpt/add base-p (vv 0.01))] + + (or col? h-start? around? between?) (conj (gpt/add base-p (hv min-width))) (and col? h-center?) @@ -74,7 +79,7 @@ (and col? h-center?) (conj (gpt/subtract base-p (hv min-width))) - (or row? v-start?) + (or row? v-start? around? between?) (conj (gpt/add base-p (vv min-height))) (and row? v-center?) diff --git a/common/src/app/common/geom/shapes/points.cljc b/common/src/app/common/geom/shapes/points.cljc index 206494d49..3722beb9e 100644 --- a/common/src/app/common/geom/shapes/points.cljc +++ b/common/src/app/common/geom/shapes/points.cljc @@ -6,6 +6,7 @@ (ns app.common.geom.shapes.points (:require + [app.common.data :as d] [app.common.geom.point :as gpt] [app.common.geom.shapes.common :as gco] [app.common.geom.shapes.intersect :as gsi] @@ -115,7 +116,9 @@ (max tv-max ctv)])) [th-min th-max tv-min tv-max] - (->> child-bounds (reduce find-boundary-ts [##Inf ##-Inf ##Inf ##-Inf])) + (->> child-bounds + (filter #(and (d/num? (:x %)) (d/num? (:y %)))) + (reduce find-boundary-ts [##Inf ##-Inf ##Inf ##-Inf])) minv-start (pv tv-min) minv-end (gpt/add minv-start hv)