 
 (defmethod draw-primitive Shape
   [g2d shape {:keys [color fill stroke] :as params}]
-  (with-g2d-state [g2d params]
-                  (when fill
-                    (when-let [fill-color (:color fill)]
-                      (doto g2d
-                        (set-color fill-color)
-                        (.fill shape))))
-                  (when (stroke? stroke)
-                    (doto g2d
-                      (set-color (or (:color stroke) color :black))
-                      (.draw shape)))))
+  (when fill
+    (when-let [fill-color (:color fill)]
+      (doto g2d
+        (set-color fill-color)
+        (.fill shape))))
+  (when (stroke? stroke)
+    (doto g2d
+      (set-color (or (:color stroke) color :black))
+      (.draw shape))))
 
 (defmethod draw-primitive Image
   [g2d image params]

      ;(draw-shape g2d obj fill stroke)
      ;(.translate g2d (- x) (- y))
      (.setFont g2d font2)
      (with-g2d-state [g2d params]
                       (draw-string-center g2d text x y))
      )))

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

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

(count
(reset!
  grafix 
  [:graphics {}
;   [:rect
;    {:x 250 :y 250 :w 10 :h 300
;     :arc-radius 100
