anchor.diff:                       :insert-default t))
     (let ((viewer (find-pane-named *application-frame* 'spectacle-pane))
           (img (read-image-file image-pathname)))
  -    (with-accessors ((image gadget-value)
  +    (with-accessors ((image image)
                        (transform-parameters transform-parameters)
                        (transform transform))
           viewer
  
positive.code:             (rads (mod (* pi degrees (/ 180)) (* 2 pi))))
          (unless (equal (elt transform-parameters param) rads)
            (setf (elt transform-parameters param) rads
                  transform nil))))
      (handle-repaint viewer (sheet-region viewer))))
  
  (defun y-shear-callback (gadget shear)
    (declare (ignore gadget))
    (let ((viewer (find-pane-named *application-frame* 'spectacle-pane)))
      (with-accessors ((image gadget-value)
                       (transform-parameters transform-parameters)
                       (transform transform))
          viewer
        (let ((param 4))
          (unless (equal (elt transform-parameters param) shear)
            (setf (elt transform-parameters param) shear
                  transform nil))))
      (handle-repaint viewer (sheet-region viewer))))
  
  (defun x-shear-callback (gadget shear)
    (declare (ignore gadget))
    (let ((viewer (find-pane-named *application-frame* 'spectacle-pane)))
      (with-accessors ((image gadget-value)
                       (transform-parameters transform-parameters)
                       (transform transform))
          viewer
        (let ((param 5))
          (unless (equal (elt transform-parameters param) shear)
            (setf (elt transform-parameters param) shear
                  transform nil))))
      (handle-repaint viewer (sheet-region viewer))))
  
  (define-application-frame spectacle ()
    ()
    (:menu-bar menubar-command-table)
    (:panes
     (viewer (make-clim-stream-pane 
              :type 'spectacle-pane
              :incremental-redisplay t
              :name 'spectacle-pane
              :width 500
              :background +black+
              :foreground +white+
              :scroll-bars :both))
     (lock-scale :toggle-button
                 :label "Lock X and Y Scale"
                 :value t
  
negative.code:                     (gadget-value x-scale-slider) scale)
                (setf (elt transform-parameters 0) scale
                      (elt transform-parameters 1) scale
                      transform nil))
              (change-space-requirements viewer :height oldy :width oldx))
            (handle-repaint viewer (or (pane-viewport-region viewer)
                                       (sheet-region viewer))))))))
  
  (define-spectacle-command (com-redraw :name t)
      ()
    (let ((viewer (find-pane-named *application-frame* 'spectacle-pane)))
      (handle-repaint viewer (or (pane-viewport-region viewer)
                                 (sheet-region viewer)))))
  
  (define-spectacle-command (com-reset :name t)
      ()
    (let ((viewer (find-pane-named *application-frame* 'spectacle-pane)))
      (with-accessors ((image image)
                       (transform-parameters transform-parameters)
                       (transform transform))
          viewer
        (reset-sliders)
        (reset-transform-parameters transform-parameters)
        (setf transform nil))
      (handle-repaint viewer (or (pane-viewport-region viewer)
                                 (sheet-region viewer)))))
  
  (define-spectacle-command (com-quit :name t :keystroke (#\q :meta)) ()
    (frame-exit *application-frame*))
  