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 72994b8732..9247f20bfe 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)}))) 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 af66d634db..5b51a8456b 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 @@ -119,13 +119,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]]) @@ -160,8 +160,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))} @@ -184,8 +184,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))} 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 25bf1c8090..bc7fae8616 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 @@ -113,7 +113,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" @@ -126,9 +126,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)}