 
 (defn draw-primitives [g2d items]
   (enable-anti-aliasing g2d)
-  (dorun
-    (for [item (flatten items)]
-      (let [params (:params item)]
-      (set-style g2d params)
-      (draw-primitive g2d (:type item) (complete-coordinates params))))))
+  (doseq [[type params inner] items]
+    (println type params inner)
+    (set-style g2d params)
+    (draw-primitive g2d type (complete-coordinates params))
+    ))
 
 (defn paint-canvas-graphics [^Graphics graphics data]
   (draw-primitives graphics data))


;; test

(def temp-data
  [
   {:type :primitive-round-rect
    :params {:l 20 :t 10 :w 140 :h 140
             :arc-radius 20
             :filled true :color Color/RED}}
   {:type :primitive-ellipse
    :params {:l 25 :t 15 :w 110 :h 90
             :filled true :color Color/YELLOW}}
   {:type :primitive-round-rect
    :params {:x 90 :y 80 :r 160 :b 150
             :arc-width 20 :arc-height 20
             :filled false :color Color/DARK_GRAY
             :stroke {:width 5
                      :dashes [10 10]}}}
   {:type :primitive-polygon
    :params {:vertices [{:x 100 :y 100}
                        {:x 50 :y 150}
                        {:x 50 :y 220}
                        {:x 160 :y 250}]

                    :italic false
                    :underline true
                    :strikethrough false
                    :size 100}}]
   [:primitive-line
    {:x 180 :y 120 :w 0 :h 150 :color Color/RED
             :stroke {:width 10 :cap :round}
             :alpha 0.7}]
   [:primitive-line
    {:x 180 :y 120 :w 30 :h 0 :color Color/GREEN
             :alpha 0.6
             :stroke {:width 4}}]
   [:primitive-arc
    {:l 60 :t 30 :w 100 :h 100
             :start-angle 30 :arc-angle 100 :color Color/GREEN
             :filled true
             :alpha 0.7}]
   ])


