Improved performand for text editing

This commit is contained in:
alonso.torres 2022-04-21 18:41:36 +02:00
parent f945a6e649
commit b7d33041e8
24 changed files with 448 additions and 328 deletions

View file

@ -423,8 +423,9 @@
shape (obj/get props "shape")
elem-name (obj/get child "type")
render-id (mf/use-ctx muc/render-ctx)
stroke-id (dm/fmt "strokes-%" (:id shape))
stroke-props (-> (obj/new)
(obj/set! "id" (dm/fmt "strokes-%" (:id shape)))
(obj/set! "id" stroke-id)
(cond->
;; There is a blur
(and (:blur shape) (not (cph/frame-shape? shape)) (-> shape :blur :hidden not))
@ -440,7 +441,7 @@
(for [[index value] (-> (d/enumerate (:strokes shape)) reverse)]
(let [props (build-stroke-props index child value render-id)
shape (assoc value :points (:points shape))]
[:& shape-custom-stroke {:shape shape :index index}
[:& shape-custom-stroke {:shape shape :index index :key (dm/str index "-" stroke-id)}
[:> elem-name props]]))])]))
(mf/defc shape-custom-strokes