mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 03:02:28 +02:00
Draw selection dashed-square when shape is drawing.
This commit is contained in:
parent
9f9bff17e5
commit
12f40744d2
2 changed files with 17 additions and 8 deletions
|
@ -36,16 +36,25 @@
|
|||
|
||||
(mx/defc draw-area
|
||||
{:mixins [mx/static mx/reactive]}
|
||||
[]
|
||||
[zoom]
|
||||
(when-let [shape (mx/react drawing-shape)]
|
||||
(if (= (:type shape) :path)
|
||||
(path-draw-area shape)
|
||||
(generic-draw-area shape))))
|
||||
(generic-draw-area shape zoom))))
|
||||
|
||||
(mx/defc generic-draw-area
|
||||
[shape]
|
||||
(-> (assoc shape :drawing? true)
|
||||
(shapes/render-component)))
|
||||
[shape zoom]
|
||||
(let [{:keys [x1 y1 width height]} (geom/size shape)]
|
||||
[:g
|
||||
(-> (assoc shape :drawing? true)
|
||||
(shapes/render-component))
|
||||
[:rect.main {:x x1 :y y1
|
||||
:width width
|
||||
:height height
|
||||
:stroke-dasharray (str (/ 5.0 zoom) "," (/ 5 zoom))
|
||||
:style {:stroke "#333" :fill "transparent"
|
||||
:stroke-opacity "1"}}]]))
|
||||
|
||||
|
||||
(mx/defc path-draw-area
|
||||
[{:keys [segments] :as shape}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue