mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 12:58:55 +00:00
Fix bugs introduced in previous commit.
This commit is contained in:
parent
1924570ea1
commit
a64c18eff7
@ -6,7 +6,7 @@
|
|||||||
[uxbox.util.data :refer (remove-nil-vals)]))
|
[uxbox.util.data :refer (remove-nil-vals)]))
|
||||||
|
|
||||||
(defn- transform-attr
|
(defn- transform-attr
|
||||||
[acc key value]
|
[data acc key value]
|
||||||
(case key
|
(case key
|
||||||
:view-box
|
:view-box
|
||||||
(assoc! acc key (apply str (interpose " " value)))
|
(assoc! acc key (apply str (interpose " " value)))
|
||||||
@ -15,8 +15,7 @@
|
|||||||
(assoc! acc :preserveAspectRatio (if value "xMidYMid" "none"))
|
(assoc! acc :preserveAspectRatio (if value "xMidYMid" "none"))
|
||||||
|
|
||||||
:rotation
|
:rotation
|
||||||
(let [width (nth (:view-box data) 3)
|
(let [center-x (+ (:x data) (/ (:width data) 2))
|
||||||
center-x (+ (:x data) (/ (:width data) 2))
|
|
||||||
center-y (+ (:y data) (/ (:height data) 2))]
|
center-y (+ (:y data) (/ (:height data) 2))]
|
||||||
(assoc! acc :transform (str/format "rotate(%s %s %s)"
|
(assoc! acc :transform (str/format "rotate(%s %s %s)"
|
||||||
value center-x center-y)))
|
value center-x center-y)))
|
||||||
@ -26,7 +25,9 @@
|
|||||||
(defn- transform-attrs
|
(defn- transform-attrs
|
||||||
[data]
|
[data]
|
||||||
(persistent!
|
(persistent!
|
||||||
(reduce-kv transform-attr (transient {}) data)))
|
(reduce-kv (partial transform-attr data)
|
||||||
|
(transient {})
|
||||||
|
data)))
|
||||||
|
|
||||||
(defn- extract-attrs
|
(defn- extract-attrs
|
||||||
"Extract predefinet attrs from shapes."
|
"Extract predefinet attrs from shapes."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user