From 216d101e56830ec788b7af347a76d1ce6bbd119e Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Mar 2023 09:28:18 +0100 Subject: [PATCH] :bug: Fix flex layout min height bigger than board when height is 100% --- common/src/app/common/geom/shapes/flex_layout/modifiers.cljc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/geom/shapes/flex_layout/modifiers.cljc b/common/src/app/common/geom/shapes/flex_layout/modifiers.cljc index 72994b873..9247f20bf 100644 --- a/common/src/app/common/geom/shapes/flex_layout/modifiers.cljc +++ b/common/src/app/common/geom/shapes/flex_layout/modifiers.cljc @@ -10,6 +10,7 @@ [app.common.geom.shapes.flex-layout.positions :as fpo] [app.common.geom.shapes.points :as gpo] [app.common.geom.shapes.transforms :as gtr] + [app.common.math :as mth] [app.common.types.modifiers :as ctm] [app.common.types.shape.layout :as ctl])) @@ -33,7 +34,7 @@ (let [line-width (min line-width (or to-bound-width line-width)) target-width (max (- line-width (ctl/child-width-margin child)) 0.01) max-width (max (ctl/child-max-width child) 0.01) - target-width (min max-width target-width) + target-width (mth/clamp target-width (ctl/child-min-width child) max-width) fill-scale (/ target-width child-width)] {:width target-width :modifiers (ctm/resize-modifiers (gpt/point fill-scale 1) child-origin transform transform-inverse)}))) @@ -57,7 +58,7 @@ (let [line-height (min line-height (or to-bound-height line-height)) target-height (max (- line-height (ctl/child-height-margin child)) 0.01) max-height (max (ctl/child-max-height child) 0.01) - target-height (min max-height target-height) + target-height (mth/clamp target-height (ctl/child-min-height child) max-height) fill-scale (/ target-height child-height)] {:height target-height :modifiers (ctm/resize-modifiers (gpt/point 1 fill-scale) child-origin transform transform-inverse)})))