0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

🎉 Make outline shows when selected

This commit is contained in:
alonso.torres 2020-06-03 15:34:29 +02:00 committed by Andrés Moya
parent e5619672d3
commit 67baeff5af

View file

@ -9,6 +9,7 @@
(ns uxbox.main.ui.workspace.shapes.frame (ns uxbox.main.ui.workspace.shapes.frame
(:require (:require
[clojure.set :as set]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.main.constants :as c] [uxbox.main.constants :as c]
@ -58,7 +59,10 @@
#(refs/make-selected (:id shape))) #(refs/make-selected (:id shape)))
selected? (mf/deref selected-iref) selected? (mf/deref selected-iref)
zoom (mf/deref refs/selected-zoom) zoom (mf/deref refs/selected-zoom)
selected-shape? (or (mf/deref refs/selected-shapes) #{})
hover? (or (mf/deref refs/current-hover) #{}) hover? (or (mf/deref refs/current-hover) #{})
outline? (set/union selected-shape? hover?)
on-mouse-down (mf/use-callback (mf/deps shape) on-mouse-down (mf/use-callback (mf/deps shape)
#(common/on-mouse-down % shape)) #(common/on-mouse-down % shape))
@ -109,6 +113,6 @@
:children children}] :children children}]
[:g.outlines [:g.outlines
(for [child (filter (comp hover? :id) children)] (for [child (filter (comp outline? :id) children)]
[:& outline {:shape (geom/transform-shape child)}])]]]))))) [:& outline {:shape (geom/transform-shape child)}])]]])))))