0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

🐛 Fix circle and path drawing.

This commit is contained in:
Andrey Antukh 2019-08-08 21:24:43 +02:00
parent 97d74f6cf1
commit 775166f5f2
4 changed files with 10 additions and 8 deletions

View file

@ -20,10 +20,10 @@
(declare circle-shape)
(mf/defc circle-component
[{:keys [id] :as shape}]
(let [modifiers (mf/deref (refs/selected-modifiers id))
[{:keys [shape] :as props}]
(let [modifiers (mf/deref (refs/selected-modifiers (:id shape)))
selected (mf/deref refs/selected-shapes)
selected? (contains? selected id)
selected? (contains? selected (:id shape))
on-mouse-down #(common/on-mouse-down % shape selected)]
[:g.shape {:class (when selected? "selected")
:on-mouse-down on-mouse-down}

View file

@ -23,15 +23,15 @@
(declare path-shape)
(mf/defc path-component
[{:keys [id] :as shape}]
(let [modifiers (mf/deref (refs/selected-modifiers id))
[{:keys [shape] :as props}]
(let [modifiers (mf/deref (refs/selected-modifiers (:id shape)))
selected (mf/deref refs/selected-shapes)
selected? (contains? selected id)]
selected? (contains? selected (:id shape))]
(letfn [(on-mouse-down [event]
(common/on-mouse-down event shape selected))
(on-double-click [event]
(when selected?
(st/emit! (uds/start-edition-mode id))))]
(st/emit! (uds/start-edition-mode (:id shape)))))]
[:g.shape {:class (when selected? "selected")
:on-double-click on-double-click
:on-mouse-down on-mouse-down}

View file

@ -65,7 +65,7 @@
[:div.color-info
[:input
{:on-change on-stroke-color-change
:value (:stroke-color shape)}]]]
:value (:stroke-color shape "")}]]]
[:span "Radius"]
[:div.row-flex

View file

@ -247,9 +247,11 @@ case $1 in
run)
run
;;
log)
log
;;
stop)
stop
;;