mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 12:38:33 +02:00
✨ Ignore constraints when flipping
This commit is contained in:
parent
c72138d15a
commit
16db31c53c
3 changed files with 24 additions and 12 deletions
|
@ -506,7 +506,7 @@
|
|||
(defn calc-child-modifiers
|
||||
"Given the modifiers to apply to the parent, calculate the corresponding
|
||||
modifiers for the child, depending on the child constraints."
|
||||
[parent child parent-modifiers]
|
||||
[parent child parent-modifiers ignore-constraints]
|
||||
(let [parent-rect (:selrect parent)
|
||||
child-rect (:selrect child)
|
||||
|
||||
|
@ -540,8 +540,12 @@
|
|||
|
||||
;; Calculate the modifiers in the horizontal and vertical directions
|
||||
;; depending on the child constraints.
|
||||
constraints-h (get child :constraints-h (spec/default-constraints-h child))
|
||||
constraints-v (get child :constraints-v (spec/default-constraints-v child))
|
||||
constraints-h (if-not ignore-constraints
|
||||
(get child :constraints-h (spec/default-constraints-h child))
|
||||
:scale)
|
||||
constraints-v (if-not ignore-constraints
|
||||
(get child :constraints-v (spec/default-constraints-v child))
|
||||
:scale)
|
||||
|
||||
modifiers-h (case constraints-h
|
||||
:left
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue