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:
parent
c3f67e6358
commit
b5796b4cdb
1 changed files with 11 additions and 12 deletions
|
@ -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}]]))
|
||||
|
|
Loading…
Reference in a new issue