0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

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