Fix group rendering.

Bug introduced in previous refactor of shapes rendering.
This commit is contained in:
Andrey Antukh 2016-06-21 18:47:08 +03:00
parent 1a8e29a0b1
commit b6bcc1795c
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -45,7 +45,8 @@
on-mouse-down #(common/on-mouse-down % shape selected) on-mouse-down #(common/on-mouse-down % shape selected)
on-mouse-up #(common/on-mouse-up % shape)] on-mouse-up #(common/on-mouse-up % shape)]
(html (html
[:g.shape {:class (when selected? "selected") [:g.shape.group-shape
{:class (when selected? "selected")
:on-mouse-down on-mouse-down :on-mouse-down on-mouse-down
:on-mouse-up on-mouse-up} :on-mouse-up on-mouse-up}
(group-shape shape render-component)]))) (group-shape shape render-component)])))
@ -68,12 +69,13 @@
shapes-by-id (get @st/state :shapes-by-id) shapes-by-id (get @st/state :shapes-by-id)
xf (comp xf (comp
(map #(get shapes-by-id %)) (map #(get shapes-by-id %))
(remove :hidden) (remove :hidden))]
(map factory))]
(html (html
[:g attrs [:g attrs
(for [item (reverse (into [] xf items))] (for [item (reverse (into [] xf items))
(rum/with-key item (str (:id item))))]))) :let [key (str (:id item))]]
(-> (factory item)
(rum/with-key key)))])))
(def group-shape (def group-shape
(mx/component (mx/component