0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00
penpot/frontend/uxbox/svg.cljs
2015-12-30 00:18:59 +02:00

17 lines
308 B
Clojure

(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)))))