mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 11:17:13 +02:00
♻️ Refactor: shape data structure, dashboard data loading...
This commit is contained in:
parent
9f8936ea40
commit
1e058463b2
56 changed files with 1785 additions and 2316 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns uxbox.main.ui.shapes.rect
|
||||
(:require
|
||||
[rumext.alpha :as mf]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.main.geom :as geom]
|
||||
[uxbox.main.refs :as refs]
|
||||
[uxbox.main.ui.shapes.attrs :as attrs]
|
||||
|
@ -46,18 +47,19 @@
|
|||
(gmt/matrix? modifier-mtx) (geom/transform shape modifier-mtx)
|
||||
:else shape)
|
||||
|
||||
{:keys [x1 y1 width height] :as shape} (geom/size shape)
|
||||
{:keys [x y width height]} shape
|
||||
|
||||
transform (when (pos? rotation)
|
||||
(str (rotate (gmt/matrix) shape)))
|
||||
|
||||
moving? (boolean modifier-mtx)
|
||||
|
||||
props {:x x1 :y y1
|
||||
:id (str "shape-" id)
|
||||
:className (classnames :move-cursor moving?)
|
||||
:width width
|
||||
:height height
|
||||
:transform transform}
|
||||
attrs (merge (attrs/extract-style-attrs shape) props)]
|
||||
[:& "rect" attrs]))
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
(assoc :x x
|
||||
:y y
|
||||
:id (str "shape-" id)
|
||||
:className (classnames :move-cursor moving?)
|
||||
:width width
|
||||
:height height
|
||||
:transform transform))]
|
||||
[:& "rect" props]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue