       ;(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+)
-         ))))
+      ))
+
+;  (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] []

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

                                (draw graphics @reference)))]
    (add-watch reference panel (fn [_ _ _ _]
                                 (.repaint panel)))
    (.setBackground panel Color/BLACK)
    panel))

;; test
