From 51a34c00919a6b468fcda12eeb0c94cd24ebd917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20F=C3=ABdorov?= Date: Wed, 29 Jan 2025 14:29:41 +0300 Subject: [PATCH] :bug: Fix swapped horizontal and vertical padding (#5708) * :bug: Fix swapped horizontal an vertical padding * :bug: Fix proper toggling when option `All` is selected --- frontend/src/app/main/ui/workspace/tokens/context_menu.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs index 41a5b876a..ecdab10e5 100644 --- a/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/context_menu.cljs @@ -90,11 +90,11 @@ :p4 "Left"} all-padding-attrs (into #{} (keys 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 (not all-selected?) (every? selected-pred horizontal-attributes)) - vertical-attributes #{:p2 :p4} + vertical-attributes #{:p1 :p3} vertical-padding-selected? (and (not all-selected?) (every? selected-pred vertical-attributes)) @@ -113,7 +113,7 @@ (let [props {:token token :shape-ids shape-ids} 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)) :else (wtch/apply-token (assoc props :attributes horizontal-attributes