💄 Minor naming consistency fix.

This commit is contained in:
Andrey Antukh 2020-05-05 18:48:21 +02:00 committed by Alonso Torres
parent 9d827d4b30
commit a2fbf99f3b
3 changed files with 10 additions and 11 deletions

View file

@ -60,10 +60,10 @@
group-shape (group/group-shape shape-wrapper)] group-shape (group/group-shape shape-wrapper)]
(mf/fnc group-wrapper (mf/fnc group-wrapper
[{:keys [shape frame] :as props}] [{:keys [shape frame] :as props}]
(let [children (mapv #(get objects %) (:shapes shape))] (let [childs (mapv #(get objects %) (:shapes shape))]
[:& group-shape {:frame frame [:& group-shape {:frame frame
:shape shape :shape shape
:children children}])))) :childs childs}]))))
(defn shape-wrapper-factory (defn shape-wrapper-factory
[objects] [objects]

View file

@ -21,12 +21,12 @@
[props] [props]
(let [frame (unchecked-get props "frame") (let [frame (unchecked-get props "frame")
shape (unchecked-get props "shape") shape (unchecked-get props "shape")
children (unchecked-get props "children") childs (unchecked-get props "childs")
is-child-selected? (unchecked-get props "is-child-selected?") is-child-selected? (unchecked-get props "is-child-selected?")
{:keys [id x y width height]} shape {:keys [id x y width height]} shape
transform (geom/transform-matrix shape)] transform (geom/transform-matrix shape)]
[:g [:g
(for [item children] (for [item childs]
[:& shape-wrapper [:& shape-wrapper
{:frame frame :shape item :key (:id item)}]) {:frame frame :shape item :key (:id item)}])

View file

@ -44,10 +44,9 @@
on-context-menu (mf/use-callback (mf/deps shape) on-context-menu (mf/use-callback (mf/deps shape)
#(common/on-context-menu % shape)) #(common/on-context-menu % shape))
children-ref (mf/use-memo (mf/deps shape) childs-ref (mf/use-memo (mf/deps shape)
#(refs/objects-by-id (:shapes shape))) #(refs/objects-by-id (:shapes shape)))
children (mf/deref children-ref) childs (mf/deref childs-ref)
is-child-selected-ref (mf/use-memo (mf/deps (:id shape)) is-child-selected-ref (mf/use-memo (mf/deps (:id shape))
#(refs/is-child-selected? (:id shape))) #(refs/is-child-selected? (:id shape)))
@ -69,6 +68,6 @@
[:& group-shape [:& group-shape
{:frame frame {:frame frame
:shape shape :shape shape
:children children :childs childs
:is-child-selected? is-child-selected?}]])))) :is-child-selected? is-child-selected?}]]))))