Previous | Next

Solomonic Debugging

(let* ( (theta 0)
        (lastx 0) )
  (gimp-context-set-foreground spiral-color)
  (while (< theta 10)
         (let* ((b 1.378)
                (r (pow b theta))
                (pi2 6.283184)
                (x (- firstx (/ (* r (cos theta)) 2)))
                (y (+ firsty (/ (* r (sin theta)) 2)))
                )
           (fibonacci-draw-line spiral-l lastx lasty x y)
           (gimp-paintbrush spiral-l 0 4 (list->vector
                                          (list lastx lasty x y)) 0 0)
           (set! theta (+ theta .1))
           (set! lastx x)
           (set! lasty y)
  
           ;; Copy it to the animated image, if appropriate
           (if (= animatedp TRUE)
               (let ((anim-l (car (gimp-layer-new animated-im width height
                                                  RGBA-IMAGE "100ms"
                                                  100 NORMAL-MODE)))
                     )
                 (gimp-image-add-layer animated-im anim-l -1)
                 (gimp-edit-copy-visible newimg)
                 (set! floating-l (car (gimp-edit-paste anim-l TRUE)))
                 (gimp-floating-sel-anchor floating-l)
               ))
           ))