mirror of
https://github.com/penpot/penpot.git
synced 2025-03-10 14:51:37 -05:00
🐛 Fix rotate board breaks paddings
This commit is contained in:
parent
bc07dad4ae
commit
4774cc4859
2 changed files with 7 additions and 5 deletions
|
@ -150,9 +150,9 @@
|
||||||
{:p1 (min (- min-y (:y1 parent-selrect)) (- (:y2 parent-selrect) max-y))
|
{:p1 (min (- min-y (:y1 parent-selrect)) (- (:y2 parent-selrect) max-y))
|
||||||
:p2 (min (- min-x (:x1 parent-selrect)) (- (:x2 parent-selrect) max-x))})]
|
:p2 (min (- min-x (:x1 parent-selrect)) (- (:x2 parent-selrect) max-x))})]
|
||||||
|
|
||||||
(cond-> {:layout-flex-dir direction}
|
(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)})
|
(not (nil? padding))
|
||||||
(not (nil? layout-gap)) (assoc :layout-gap layout-gap)))))
|
(assoc :layout-padding {:p1 (:p1 padding) :p2 (:p2 padding) :p3 (:p1 padding) :p4 (:p2 padding)})))))
|
||||||
|
|
||||||
(defn shapes->grid-params
|
(defn shapes->grid-params
|
||||||
"Given the shapes calculate its flex parameters (horizontal vs vertical, gaps, etc)"
|
"Given the shapes calculate its flex parameters (horizontal vs vertical, gaps, etc)"
|
||||||
|
|
|
@ -225,12 +225,14 @@
|
||||||
show-padding? (and (nil? transform)
|
show-padding? (and (nil? transform)
|
||||||
(= (count selected-shapes) 1)
|
(= (count selected-shapes) 1)
|
||||||
(= (:type (first selected-shapes)) :frame)
|
(= (: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)
|
show-margin? (and (nil? transform)
|
||||||
(= (count selected-shapes) 1)
|
(= (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-dom-events zoom disable-paste in-viewport? workspace-read-only?)
|
||||||
(hooks/setup-viewport-size vport viewport-ref)
|
(hooks/setup-viewport-size vport viewport-ref)
|
||||||
|
|
Loading…
Add table
Reference in a new issue