🐛 Lay out the parent of a new bool again

A bool takes the bounds of its result, smaller than those of the shapes
it combines for an intersection, but creating it did not update the
layout it is in, so in a grid board it kept a place the layout does not
give it. It now updates the layout of its parent, as grouping does.

The benchmark covers JVM code; this change is ClojureScript only, so it
is not run.

AI-assisted-by: claude-opus-5-5
This commit is contained in:
alonso.torres 2026-11-14 23:53:20 +01:00
parent d659ab3b9e
commit 8c57e7b3a9
2 changed files with 11 additions and 1 deletions

View File

@ -30,7 +30,10 @@
(dsh/process-selected objects))]
(when-let [[shape changes] (clb/generate-create-bool it page-id objects ids type force-shape-id)]
(rx/of (dch/commit-changes changes)
(dws/select-shapes (d/ordered-set (:id shape)))))))))
(dws/select-shapes (d/ordered-set (:id shape)))
;; the bool takes the bounds of its result, which the layout it
;; is in places again
(ptk/data-event :layout/update {:ids [(:parent-id shape)]})))))))
(defn group-to-bool
[shape-id type]

View File

@ -1109,3 +1109,10 @@
(await (replay {:world [2 0 {:variants false :rich-variants false :text true :layout :flex
:layout-copies false :layout-children true}]
:ops [[:structure 11 1 13] [:structure 0 3]]})))
(t/deftest ^:async generated-a-bool-in-a-grid-is-placed-by-it
;; a bool takes the bounds of its result, which the grid it is in places
(await (replay {:world [3 0 {:variants true :rich-variants true :text true :layout :grid
:layout-copies true :layout-children true}]
:ops [[:rotate 16 0 7 0] [:grid-direction 0 0 0 1] [:grid-cell 0 10 0 1] [:add-child 0]
[:structure 3 6 15] [:grid-direction 0 0 0 1] [:grid-cell 0 4 2 1]]})))