0
Fork 0
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:
Andrey Antukh 2016-08-22 17:29:31 +03:00
parent a4f29d25e1
commit 99aa09eb86
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
8 changed files with 11 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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")

View file

@ -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

View file

@ -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)]