0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-10 06:41:40 -05:00

🐛 Fix rotate board breaks paddings

This commit is contained in:
Pablo Alba 2023-03-24 17:40:42 +01:00 committed by Alonso Torres
parent bc07dad4ae
commit 4774cc4859
2 changed files with 7 additions and 5 deletions

View file

@ -150,9 +150,9 @@
{:p1 (min (- min-y (:y1 parent-selrect)) (- (:y2 parent-selrect) max-y))
:p2 (min (- min-x (:x1 parent-selrect)) (- (:x2 parent-selrect) max-x))})]
(cond-> {:layout-flex-dir direction}
(not (nil? padding)) (assoc :layout-padding {:p1 (:p1 padding) :p2 (:p2 padding) :p3 (:p1 padding) :p4 (:p2 padding)})
(not (nil? layout-gap)) (assoc :layout-gap layout-gap)))))
(cond-> {:layout-flex-dir direction :layout-gap layout-gap}
(not (nil? padding))
(assoc :layout-padding {:p1 (:p1 padding) :p2 (:p2 padding) :p3 (:p1 padding) :p4 (:p2 padding)})))))
(defn shapes->grid-params
"Given the shapes calculate its flex parameters (horizontal vs vertical, gaps, etc)"

View file

@ -225,12 +225,14 @@
show-padding? (and (nil? transform)
(= (count selected-shapes) 1)
(= (:type (first selected-shapes)) :frame)
(= (:layout (first selected-shapes)) :flex))
(= (:layout (first selected-shapes)) :flex)
(zero? (:rotation (first selected-shapes))))
show-margin? (and (nil? transform)
(= (count selected-shapes) 1)
(= (:layout selected-frame) :flex))]
(= (:layout selected-frame) :flex)
(zero? (:rotation (first selected-shapes))))]
(hooks/setup-dom-events zoom disable-paste in-viewport? workspace-read-only?)
(hooks/setup-viewport-size vport viewport-ref)