mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 12:59:12 -05:00
⚡ Efficiency improvements on outlines component
This commit is contained in:
parent
c3f67e6358
commit
b5796b4cdb
1 changed files with 11 additions and 12 deletions
|
@ -92,18 +92,17 @@
|
||||||
edition (obj/get props "edition")
|
edition (obj/get props "edition")
|
||||||
zoom (obj/get props "zoom")
|
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
|
[:g.outlines
|
||||||
[:& shape-outlines-render {:shapes shapes :zoom zoom}]]))
|
[:& shape-outlines-render {:shapes shapes :zoom zoom}]]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue