mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 00:49:28 -05:00
Fix lense/ref naming on shapes related ns.
This commit is contained in:
parent
a4f29d25e1
commit
99aa09eb86
8 changed files with 11 additions and 11 deletions
|
@ -20,7 +20,7 @@
|
|||
(defn- circle-component-render
|
||||
[own shape]
|
||||
(let [{:keys [id x y width height group]} shape
|
||||
selected (mx/react common/selected-shapes-ref)
|
||||
selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(html
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
;; --- Lenses
|
||||
|
||||
(def selected-shapes-ref
|
||||
(-> (l/in [:workspace :selected])
|
||||
(l/derive st/state)))
|
||||
|
||||
(def drawing-state-ref
|
||||
(-> (l/in [:workspace :drawing])
|
||||
(l/derive st/state)))
|
||||
|
||||
(def selected-ref
|
||||
(-> (l/in [:workspace :selected])
|
||||
(l/derive st/state)))
|
||||
|
||||
;; --- Events
|
||||
|
||||
(defn on-mouse-down
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
(defn- group-component-render
|
||||
[own shape]
|
||||
(let [{:keys [id x y width height group]} shape
|
||||
selected (mx/react common/selected-shapes-ref)
|
||||
selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(html
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
(defn- icon-component-render
|
||||
[own {:keys [id] :as shape}]
|
||||
(let [selected (mx/react common/selected-shapes-ref)
|
||||
(let [selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(html
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
(defn- line-component-render
|
||||
[own shape]
|
||||
(let [{:keys [id x y width height group]} shape
|
||||
selected (mx/react common/selected-shapes-ref)
|
||||
selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(html
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
(mx/defc path-component
|
||||
{:mixins [mx/static mx/reactive]}
|
||||
[{:keys [id] :as shape}]
|
||||
(let [selected (mx/react common/selected-shapes-ref)
|
||||
(let [selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
[:g.shape {:class (when selected? "selected")
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
(defn- rect-component-render
|
||||
[own shape]
|
||||
(let [{:keys [id x y width height group]} shape
|
||||
selected (mx/react common/selected-shapes-ref)
|
||||
selected (mx/react common/selected-ref)
|
||||
selected? (contains? selected id)
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(html
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
(mx/defcs text-component
|
||||
{:mixins [mx/static mx/reactive (mx/local)]}
|
||||
[own {:keys [id x1 y1 content group] :as shape}]
|
||||
(let [selected (mx/react common/selected-shapes-ref)
|
||||
(let [selected (mx/react common/selected-ref)
|
||||
selected? (and (contains? selected id)
|
||||
(= (count selected) 1))
|
||||
local (:rum/local own)]
|
||||
|
|
Loading…
Add table
Reference in a new issue