Compare commits

...

1 Commits

Author SHA1 Message Date
Belén Albeza
5b1766835f 🐛 Fix broken selection on duplicated shapes on new pages 2026-01-21 10:32:13 +01:00
2 changed files with 10 additions and 2 deletions

View File

@@ -227,7 +227,7 @@
:svg-attrs
(do
(api/set-shape-svg-attrs v)
;; Always update fills/blur/shadow to clear previous state if filters disappear
;; Always update fills/blur/shadow to clear previous state if filters disappear
(api/set-shape-fills id (:fills shape) false)
(api/set-shape-blur (:blur shape))
(api/set-shape-shadows (:shadow shape)))
@@ -397,12 +397,18 @@
(next es))
(throw (js/Error. "conj on a map takes map entries or seqables of map entries"))))))))
(def ^:private xf:without-id-and-type
(remove (fn [kvpair]
(let [k (key kvpair)]
(or (= k :id)
(= k :type))))))
(defn create-shape
"Instanciate a shape from a map"
[attrs]
(ShapeProxy. (:id attrs)
(:type attrs)
(dissoc attrs :id :type)))
(into {} xf:without-id-and-type attrs)))
(t/add-handlers!
;; We only add a write handler, read handler uses the dynamic dispatch

View File

@@ -58,6 +58,8 @@
(swap! state update ::snap snap/update-page old-page new-page)
(swap! state update ::selection selection/update-page old-page new-page))
(catch :default cause
(log/error :hint "error updating page index" :id page-id :cause cause))
(finally
(let [elapsed (tpoint)]
(log/dbg :hint "page index updated" :id page-id :elapsed elapsed ::log/sync? true))))