0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-14 16:51:18 -05:00

💄 Many cosmetic and indentation changes on outlines component

This commit is contained in:
Andrey Antukh 2022-07-28 08:32:32 +02:00
parent 1477837cbf
commit c3f67e6358

View file

@ -76,6 +76,11 @@
:zoom zoom :zoom zoom
:color color}]))) :color color}])))
(defn- show-outline?
[shape]
(and (not (:hidden shape))
(not (:blocked shape))))
(mf/defc shape-outlines (mf/defc shape-outlines
{::mf/wrap-props false} {::mf/wrap-props false}
[props] [props]
@ -87,12 +92,10 @@
edition (obj/get props "edition") edition (obj/get props "edition")
zoom (obj/get props "zoom") zoom (obj/get props "zoom")
outlines-ids (set/union selected hover) outlines (set/union selected hover)
show-outline? (fn [shape] (and (not (:hidden shape))
(not (:blocked shape))))
shapes (d/concat-set shapes (d/concat-set
(->> outlines-ids (->> outlines
(filter #(not= edition %)) (filter #(not= edition %))
(map #(get objects %)) (map #(get objects %))
(filterv show-outline?) (filterv show-outline?)
@ -103,5 +106,4 @@
(map #(get objects %)) (map #(get objects %))
(filter some?)))] (filter some?)))]
[:g.outlines [:g.outlines
[:& shape-outlines-render {:shapes shapes [:& shape-outlines-render {:shapes shapes :zoom zoom}]]))
:zoom zoom}]]))