mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
🐛 Let the WASM engine lay out a move inside a group a layout places
With WASM on, a pure move skips the engine unless a moved shape is in a
layout's flow. A shape moved inside a group or bool that a layout places
took that shortcut: the group grew to it and stayed where the move left
it, where the CLJS engine's layout puts the group back in its place.
The check now walks up through the groups and bools around a moved
shape, and a move whose group a layout places goes through the engine.
Found by the WASM replay of the pinned generated programs (program 169,
`{:world [1 0 {:layout :flex :layout-children true}] :ops [[:structure
0 0 19] [:transform 10 0 0 12]]}`), which passes now; the WASM path does
not run in the node tests.
ClojureScript only; the benchmark covers JVM code and is not run.
AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
4eb537b3f7
commit
415206fa9f
@ -644,13 +644,26 @@
|
||||
snap-pixel?
|
||||
(and (not ignore-snap-pixel) (contains? (:workspace-layout state) :snap-pixel-grid))
|
||||
|
||||
;; a layout places the shapes in its flow, so moving one is
|
||||
;; for the engine to lay out, not a translation to splat
|
||||
;; a layout places the shapes in its flow, and the groups
|
||||
;; and bools it places take their bounds from their shapes,
|
||||
;; so moving one is for the engine to lay out, not a
|
||||
;; translation to splat
|
||||
laid-out?
|
||||
(some (fn [id]
|
||||
(let [shape (get objects id)]
|
||||
(and (ctl/any-layout-immediate-child? objects shape)
|
||||
(not (ctl/position-absolute? shape)))))
|
||||
(loop [shape (get objects id)]
|
||||
(cond
|
||||
(nil? shape)
|
||||
false
|
||||
|
||||
(and (ctl/any-layout-immediate-child? objects shape)
|
||||
(not (ctl/position-absolute? shape)))
|
||||
true
|
||||
|
||||
(cfh/group-like-shape? (get objects (:parent-id shape)))
|
||||
(recur (get objects (:parent-id shape)))
|
||||
|
||||
:else
|
||||
false)))
|
||||
(keys modif-tree))
|
||||
|
||||
transforms
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user