mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 08:11:30 -05:00
🐛 Fix bug on curve path edition mode.
This commit is contained in:
parent
f0230c346c
commit
12637bbfe4
2 changed files with 8 additions and 7 deletions
|
@ -8,7 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[cuerdas.core :as str :include-macros true]
|
[cuerdas.core :as str :include-macros true]
|
||||||
[rumext.alpha :as mf]
|
[rumext.alpha :as mf]
|
||||||
[uxbox.main.data.workspace :as udw]
|
[uxbox.main.data.workspace :as dw]
|
||||||
[uxbox.main.geom :as geom]
|
[uxbox.main.geom :as geom]
|
||||||
[uxbox.main.refs :as refs]
|
[uxbox.main.refs :as refs]
|
||||||
[uxbox.main.store :as st]
|
[uxbox.main.store :as st]
|
||||||
|
@ -29,8 +29,8 @@
|
||||||
(common/on-mouse-down event shape selected))
|
(common/on-mouse-down event shape selected))
|
||||||
(on-double-click [event]
|
(on-double-click [event]
|
||||||
(when selected?
|
(when selected?
|
||||||
(prn "on-double-click")
|
(prn "path-component$on-double-click")
|
||||||
(st/emit! (udw/start-edition-mode (:id shape)))))]
|
(st/emit! (dw/start-edition-mode (:id shape)))))]
|
||||||
[:g.shape {:class (when selected? "selected")
|
[:g.shape {:class (when selected? "selected")
|
||||||
:on-double-click on-double-click
|
:on-double-click on-double-click
|
||||||
:on-mouse-down on-mouse-down}
|
:on-mouse-down on-mouse-down}
|
||||||
|
|
|
@ -229,7 +229,7 @@
|
||||||
[{:keys [wst] :as props}]
|
[{:keys [wst] :as props}]
|
||||||
(let [shapes-map (mf/deref shapes-map-iref)
|
(let [shapes-map (mf/deref shapes-map-iref)
|
||||||
shapes (map #(get shapes-map %) (:selected wst))
|
shapes (map #(get shapes-map %) (:selected wst))
|
||||||
edition? (:edition wst)
|
edition (:edition wst)
|
||||||
zoom (:zoom wst 1)
|
zoom (:zoom wst 1)
|
||||||
num (count shapes)
|
num (count shapes)
|
||||||
{:keys [id type] :as shape} (first shapes)]
|
{:keys [id type] :as shape} (first shapes)]
|
||||||
|
@ -243,11 +243,12 @@
|
||||||
:zoom zoom}]
|
:zoom zoom}]
|
||||||
|
|
||||||
(and (= type :text)
|
(and (= type :text)
|
||||||
(= edition? (:id shape)))
|
(= edition (:id shape)))
|
||||||
[:& text-edition-selection-handlers {:shape shape
|
[:& text-edition-selection-handlers {:shape shape
|
||||||
:zoom zoom}]
|
:zoom zoom}]
|
||||||
(and (= type :path)
|
(and (or (= type :path)
|
||||||
(= edition? (:id shape)))
|
(= type :curve))
|
||||||
|
(= edition (:id shape)))
|
||||||
[:& path-edition-selection-handlers {:shape shape
|
[:& path-edition-selection-handlers {:shape shape
|
||||||
:zoom zoom}]
|
:zoom zoom}]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue