0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

Efficiency improvements on outlines component

This commit is contained in:
Andrey Antukh 2022-07-28 08:38:40 +02:00
parent c3f67e6358
commit b5796b4cdb

View file

@ -92,18 +92,17 @@
edition (obj/get props "edition")
zoom (obj/get props "zoom")
outlines (set/union selected hover)
lookup (d/getf objects)
edition? (fn [o] (= edition o))
shapes (-> #{}
(into (comp (remove edition?)
(keep lookup)
(filter show-outline?))
(set/union selected hover))
(into (comp (remove edition?)
(keep lookup))
highlighted))]
shapes (d/concat-set
(->> outlines
(filter #(not= edition %))
(map #(get objects %))
(filterv show-outline?)
(filter some?))
;; outline highlighted shapes even if they are hidden or blocked
(->> highlighted
(filter #(not= edition %))
(map #(get objects %))
(filter some?)))]
[:g.outlines
[:& shape-outlines-render {:shapes shapes :zoom zoom}]]))