From 216d101e56830ec788b7af347a76d1ce6bbd119e Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Mar 2023 09:28:18 +0100 Subject: [PATCH 1/4] :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)}))) From 89fbe28ed1140d2386102bebcac6448e9a9f015d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Mar 2023 11:17:24 +0100 Subject: [PATCH 2/4] :bug: Fix wrap and nowrap spelling issues --- .../ui/workspace/sidebar/options/menus/layout_container.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs index f9ab4558b..d22833876 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs @@ -118,13 +118,13 @@ [:* [:button.tooltip.tooltip-bottom {:class (dom/classnames :active (= wrap-type :nowrap)) - :alt "Nowrap" + :alt "No wrap" :on-click #(set-wrap :nowrap) :style {:padding 0}} [:span.no-wrap i/minus]] [:button.wrap.tooltip.tooltip-bottom {:class (dom/classnames :active (= wrap-type :wrap)) - :alt "wrap" + :alt "Wrap" :on-click #(set-wrap :wrap)} i/auto-wrap]]) From fc1f2b2a9f0d31e21fb8735e42f9e22fe347187b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Mar 2023 11:40:45 +0100 Subject: [PATCH 3/4] :bug: Fix some layout tooltips cropped --- .../workspace/sidebar/options/menus/layout_container.cljs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs index d22833876..4e006752c 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs @@ -159,8 +159,8 @@ (for [align [:space-between :space-around :space-evenly]] [:button.align-content.tooltip {:class (dom/classnames :active (= align-content align) - :tooltip-bottom-left (not= align :start) - :tooltip-bottom (= align :start)) + :tooltip-bottom-left (not= align :space-between) + :tooltip-bottom (= align :space-between)) :alt (dm/str "Align content " (d/name align)) :on-click #(set-align-content align) :key (dm/str "align-content" (d/name align))} @@ -183,8 +183,8 @@ (for [justify [:space-between :space-around :space-evenly]] [:button.justify.tooltip {:class (dom/classnames :active (= justify-content justify) - :tooltip-bottom-left (not= justify :space-around) - :tooltip-bottom (= justify :space-around)) + :tooltip-bottom-left (not= justify :space-between) + :tooltip-bottom (= justify :space-between)) :alt (dm/str "Justify content " (d/name justify)) :on-click #(set-justify justify) :key (dm/str "justify-content" (d/name justify))} From 9a272f69c7c6cc30587a58f17ea25d7da67153c1 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 1 Mar 2023 11:45:00 +0100 Subject: [PATCH 4/4] :bug: Fix height 100% cropped --- .../ui/workspace/sidebar/options/menus/layout_item.cljs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_item.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_item.cljs index af4f796d2..8ce57f231 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_item.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_item.cljs @@ -112,7 +112,7 @@ {:alt "Width 100%" :class (dom/classnames :active (= layout-item-h-sizing :fill)) :on-click #(on-change-behavior :h :fill)} - i/auto-fill]) + i/auto-fill]) (when auto? [:button.behavior-btn.tooltip.tooltip-bottom {:alt "Fit content" @@ -125,9 +125,9 @@ {:alt "Fix height" :class (dom/classnames :active (= layout-item-v-sizing :fix)) :on-click #(on-change-behavior :v :fix)} - i/auto-fix-layout] + i/auto-fix-layout] (when fill? - [:button.behavior-btn.tooltip.tooltip-bottom + [:button.behavior-btn.tooltip.tooltip-bottom-left {:alt "Height 100%" :class (dom/classnames :active (= layout-item-v-sizing :fill)) :on-click #(on-change-behavior :v :fill)} @@ -207,7 +207,7 @@ :layout-item-v-sizing (or (:layout-item-v-sizing values) :fix) :layout-item-h-sizing (or (:layout-item-h-sizing values) :fix) :on-change-behavior on-change-behavior}]] - + (when is-layout-child? [:div.layout-row [:div.row-title "Align"]