mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 22:19:19 +00:00
🐛 Fix swapped horizontal and vertical padding (#5708)
* 🐛 Fix swapped horizontal an vertical padding * 🐛 Fix proper toggling when option `All` is selected
This commit is contained in:
parent
48b225f3fe
commit
51a34c0091
@ -90,11 +90,11 @@
|
|||||||
:p4 "Left"}
|
:p4 "Left"}
|
||||||
all-padding-attrs (into #{} (keys padding-attrs))
|
all-padding-attrs (into #{} (keys padding-attrs))
|
||||||
{:keys [all-selected? selected-pred shape-ids]} (attribute-actions token selected-shapes all-padding-attrs)
|
{:keys [all-selected? selected-pred shape-ids]} (attribute-actions token selected-shapes all-padding-attrs)
|
||||||
horizontal-attributes #{:p1 :p3}
|
horizontal-attributes #{:p2 :p4}
|
||||||
horizontal-padding-selected? (and
|
horizontal-padding-selected? (and
|
||||||
(not all-selected?)
|
(not all-selected?)
|
||||||
(every? selected-pred horizontal-attributes))
|
(every? selected-pred horizontal-attributes))
|
||||||
vertical-attributes #{:p2 :p4}
|
vertical-attributes #{:p1 :p3}
|
||||||
vertical-padding-selected? (and
|
vertical-padding-selected? (and
|
||||||
(not all-selected?)
|
(not all-selected?)
|
||||||
(every? selected-pred vertical-attributes))
|
(every? selected-pred vertical-attributes))
|
||||||
@ -113,7 +113,7 @@
|
|||||||
(let [props {:token token
|
(let [props {:token token
|
||||||
:shape-ids shape-ids}
|
:shape-ids shape-ids}
|
||||||
event (cond
|
event (cond
|
||||||
all-selected? (wtch/apply-token (assoc props :attributes-to-remove vertical-attributes))
|
all-selected? (wtch/apply-token (assoc props :attributes-to-remove horizontal-attributes))
|
||||||
horizontal-padding-selected? (wtch/apply-token (assoc props :attributes-to-remove horizontal-attributes))
|
horizontal-padding-selected? (wtch/apply-token (assoc props :attributes-to-remove horizontal-attributes))
|
||||||
:else (wtch/apply-token (assoc props
|
:else (wtch/apply-token (assoc props
|
||||||
:attributes horizontal-attributes
|
:attributes horizontal-attributes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user