0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Merge pull request #5320 from penpot/alotor-fix-problem-layouts

🐛 Fix problem with layout reflow
This commit is contained in:
Andrey Antukh 2024-11-18 18:44:42 +01:00 committed by GitHub
commit 4466abd150
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -529,13 +529,6 @@
(or (d/not-empty? (dm/get-prop modifiers :geometry-child))
(d/not-empty? (dm/get-prop modifiers :structure-child))))
(defn only-move?
"Returns true if there are only move operations"
[modifiers]
(let [move-op? #(= :move (dm/get-prop % :type))]
(and (every? move-op? (dm/get-prop modifiers :geometry-child))
(every? move-op? (dm/get-prop modifiers :geometry-parent)))))
(defn has-geometry?
[modifiers]
(or (d/not-empty? (dm/get-prop modifiers :geometry-parent))
@ -550,6 +543,14 @@
[modifiers]
(d/not-empty? (dm/get-prop modifiers :structure-child)))
(defn only-move?
"Returns true if there are only move operations"
[modifiers]
(let [move-op? #(= :move (dm/get-prop % :type))]
(and (not (has-structure? modifiers))
(every? move-op? (dm/get-prop modifiers :geometry-child))
(every? move-op? (dm/get-prop modifiers :geometry-parent)))))
;; Extract subsets of modifiers
(defn select-child