mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 08:29:42 -05:00
🐛 Fix problem with index updating
This commit is contained in:
parent
7ff608ff0b
commit
4613aef1c8
1 changed files with 7 additions and 7 deletions
|
@ -23,7 +23,7 @@
|
||||||
(defn index-shape
|
(defn index-shape
|
||||||
[objects parents-index masks-index]
|
[objects parents-index masks-index]
|
||||||
(fn [index shape]
|
(fn [index shape]
|
||||||
(let [{:keys [x y width height]} (:selrect shape)
|
(let [{:keys [x y width height]} (gsh/points->selrect (:points shape))
|
||||||
shape-bound #js {:x x :y y :width width :height height}
|
shape-bound #js {:x x :y y :width width :height height}
|
||||||
|
|
||||||
parents (get parents-index (:id shape))
|
parents (get parents-index (:id shape))
|
||||||
|
@ -42,11 +42,10 @@
|
||||||
(let [shapes (-> objects (dissoc uuid/zero) (vals))
|
(let [shapes (-> objects (dissoc uuid/zero) (vals))
|
||||||
parents-index (cp/generate-child-all-parents-index objects)
|
parents-index (cp/generate-child-all-parents-index objects)
|
||||||
masks-index (cp/create-mask-index objects parents-index)
|
masks-index (cp/create-mask-index objects parents-index)
|
||||||
bounds (gsh/selection-rect shapes)
|
bounds #js {:x (int -0.5e7)
|
||||||
bounds #js {:x (:x bounds)
|
:y (int -0.5e7)
|
||||||
:y (:y bounds)
|
:width (int 1e7)
|
||||||
:width (:width bounds)
|
:height (int 1e7)}
|
||||||
:height (:height bounds)}
|
|
||||||
|
|
||||||
index (reduce (index-shape objects parents-index masks-index)
|
index (reduce (index-shape objects parents-index masks-index)
|
||||||
(qdt/create bounds)
|
(qdt/create bounds)
|
||||||
|
@ -65,7 +64,8 @@
|
||||||
(get new-objects id)))
|
(get new-objects id)))
|
||||||
|
|
||||||
changed-ids (into #{}
|
changed-ids (into #{}
|
||||||
(filter changes?)
|
(comp (filter changes?)
|
||||||
|
(filter #(not= % uuid/zero)))
|
||||||
(set/union (keys old-objects)
|
(set/union (keys old-objects)
|
||||||
(keys new-objects)))
|
(keys new-objects)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue