mirror of
https://github.com/penpot/penpot.git
synced 2026-09-13 15:38:38 +00:00
Convert rect-shape component to use new defc macro.
This commit is contained in:
parent
9b078e19a8
commit
6d82194f9f
@ -9,7 +9,7 @@
|
|||||||
[rum.core :as rum]
|
[rum.core :as rum]
|
||||||
[uxbox.main.ui.shapes.common :as common]
|
[uxbox.main.ui.shapes.common :as common]
|
||||||
[uxbox.main.ui.shapes.attrs :as attrs]
|
[uxbox.main.ui.shapes.attrs :as attrs]
|
||||||
[uxbox.util.mixins :as mx]
|
[uxbox.util.mixins :as mx :include-macros true]
|
||||||
[uxbox.main.geom :as geom]
|
[uxbox.main.geom :as geom]
|
||||||
[uxbox.util.dom :as dom]))
|
[uxbox.util.dom :as dom]))
|
||||||
|
|
||||||
@ -38,19 +38,12 @@
|
|||||||
|
|
||||||
;; --- Rect Shape
|
;; --- Rect Shape
|
||||||
|
|
||||||
(defn- rect-shape-render
|
(mx/defc rect-shape
|
||||||
[own {:keys [id x1 y1 x2 y2] :as shape}]
|
[{:keys [id x1 y1 x2 y2] :as shape}]
|
||||||
(let [key (str id)
|
(let [key (str id)
|
||||||
rfm (geom/transformation-matrix shape)
|
rfm (geom/transformation-matrix shape)
|
||||||
size (geom/size shape)
|
size (geom/size shape)
|
||||||
props {:x x1 :y y1 :id key :key key :transform (str rfm)}
|
props {:x x1 :y y1 :id key :key key :transform (str rfm)}
|
||||||
attrs (-> (attrs/extract-style-attrs shape)
|
attrs (-> (attrs/extract-style-attrs shape)
|
||||||
(merge props size))]
|
(merge props size))]
|
||||||
(html
|
[:rect attrs]))
|
||||||
[:rect attrs])))
|
|
||||||
|
|
||||||
(def rect-shape
|
|
||||||
(mx/component
|
|
||||||
{:render rect-shape-render
|
|
||||||
:name "rect-shape"
|
|
||||||
:mixins [mx/static]}))
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user