                  (float (- x (/ width 2)))
                  (float (+ y (/ height 2))))))
 
-(defmethod draw-primitive :primitive-text
+(defmethod draw-primitive :text
   [g2d shape  {:keys [text x y font]}]
   (let [{:keys [name bold italic underline strikethrough size]} font
         style (bit-or (if bold Font/BOLD 0) (if italic Font/ITALIC 0))

            :underline false
            :strikethrough false
            :size 60}}]
   [:primitive-line
    {:x 180 :y 220 :w 0 :h 50 :color :red
     :stroke {:width 10 :cap :round}
     :alpha 0.7}]
   [:primitive-line
    {:x 180 :y 220 :w 30 :h 0 :color 0x00AA00
     :alpha 0.6
     :stroke {:width 4}}]
   [:primitive-arc
    {:l 30 :t 20 :w 150 :h 100
     :start-angle 30 :arc-angle 100 :color :green
     :filled true
     :alpha 0.7}]
   ])


   
(defmulti draw-primitive (fn [g2d shape params] shape))

(defmethod draw-primitive :arc
  [g2d shape {:keys [l t w h filled start-angle arc-angle]}]
  (if filled
    (.fillArc g2d l t w h start-angle arc-angle)
    (.drawArc g2d l t w h start-angle arc-angle)))

(defmethod draw-primitive :ellipse
  [g2d shape {:keys [l t w h filled]}]
  (if filled
    (.fillOval g2d l t w h)
    (.drawOval g2d l t w h)))

(defmethod draw-primitive :image
  [g2d shape {:keys [image l t w h]}]
  (.drawImage g2d image
              l t
              (or w (.getWidth image))
              (or h (.getHeight image)) nil))

(defmethod draw-primitive :line
  [g2d shape {:keys [l t r b filled]}]
  (.drawLine g2d l t r b))

(defmethod draw-primitive :polygon
  [g2d shape {:keys [vertices filled closed]}]
  (let [xs (int-array (map :x vertices))
        ys (int-array (map :y vertices))
