mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
94e87f8a7d
3 changed files with 12 additions and 11 deletions
|
@ -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)})))
|
||||
|
|
|
@ -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))}
|
||||
|
|
|
@ -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)}
|
||||
|
|
Loading…
Add table
Reference in a new issue