0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00
penpot/frontend/uxbox/svg.cljs

18 lines
308 B
Text
Raw Normal View History

2015-06-18 12:35:50 -05:00
(ns uxbox.svg)
(defn translate
[x y]
(str "translate(" x "," y ")"))
(defn rotate
[d]
(str "rotate(" d ")"))
(defn transform
[{:keys [center] :as opts}]
(let [r (get opts :rotate 0)
{:keys [x y]} center]
(str (translate x y)
(rotate r)
(translate (- x) (- y)))))