[mcclim-devel] Bug in draw-circle using transformation

Paul Werkowski pw at snoopy.mv.com
Tue Dec 20 13:56:39 UTC 2005


(in-package :clim-user)

;;; In Lispworks CLIM, this program draws an arc (counter-clockwise)
;;; from red dot to blue dot.
;;; In McCLIM, xlib:draw-arc throws a type error,
;;;  7.85398 is not of type (satisfies xlib:anglep) 
;;; Changing start angle (as) to zero gets past that error, but the arc
;;; is going in the wrong direction (clockwise) from red dot.

(define-application-frame test ()
  ()
  (:panes
   (p0 :application
       :display-function
       (lambda (f p)
	 (declare (ignore f))
	 (with-translation (p 10 150)
	   (with-scaling (p 1 -1)
             (let* ((as (/ pi 8))
                    (ae (+ as (/ pi 2)))
                    (r 20)
                    (x0 50)(y0 50)
                    (xs (+ x0 (* r (cos as))))
                    (ys (+ y0 (* r (sin as))))
                    (xe (+ x0 (* r (cos ae))))
                    (ye (+ y0 (* r (sin ae)))))
               (draw-line* p 0 0 0 100)
               (draw-line* p 0 0 100 0)
               ;; Arc center
               (draw-circle* p x0 y0 3 :ink +green+)
               ;; Where the arc should start
               (draw-circle* p xs ys 3 :ink +red+)
               ;; Where the arc should end
               (draw-circle* p xe ye 3 :ink +blue+)
               (draw-circle* p x0 y0 r
                             :start-angle as :end-angle ae :filled nil)))))
       :width 200 :height 200))
  (:layouts
   (default p0)))

(defun testme ()
  (run-frame-top-level
   (make-application-frame 'test)))




More information about the mcclim-devel mailing list