         h (or (:h params) (.getHeight image))
         params+ (complete-coordinates (assoc params :w w :h h))
         {:keys [l t]} params+]
-    (with-g2d-state [g2d params+]
-                    (.drawImage g2d image (- (/ w 2)) (- (/ h 2)) w h nil))))
+    (.drawImage g2d image (- (/ w 2)) (- (/ h 2)) w h nil)))
 
 (defn draw-string-center
   "Draw a string centered at position x,y."

;              :cap :butt
;              :join :bevel
;              :miter-limit 10.0}}]
   [:rect
    {:x 200 :y 200 :w 1000 :h 1000 :fill {:color :black}}]
   [:compound {:x 180 :y 300 :scale 1.0 :alpha 0.5 :rotate 0} 
    [:round-rect
     {:y 2 :w 150 :h 30
      :arc-radius 10

      ;(draw-shape g2d obj fill stroke)
      ;(.translate g2d (- x) (- y))
      (.setFont g2d font2)
                       (draw-string-center g2d text x y))
      ))

;  (enable-anti-aliasing g2d)
;  (doseq [[type params & inner-items] items]

(defn draw [g2d [type params & inner-items]]
  (when (= type :graphics)
        (enable-anti-aliasing g2d))
  (let [params+ (complete-coordinates params)]
    (with-g2d-state [g2d params+]
      (if (#{:compound :graphics} type)
        (doseq [inner-item inner-items]
          (draw g2d inner-item))
        (draw-primitive g2d (make-obj type params+) params+)))))

(defn canvas [reference]
  (let [panel (proxy [JPanel] []
