anchor.diff:  ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
   ;;; --------------------------------------------------------------------------------------
   ;;;     Title: The CLIM Transformations
  -;;;   Created: 1998-09-29 20:23
  +;;;   Created: 1998-09-29
   ;;;    Author: Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
   ;;;   License: LGPL (See file COPYING for details).
  +;;;       $Id: transforms.lisp,v 1.23 2003-08-09 00:55:40 gilbert Exp $
   ;;; --------------------------------------------------------------------------------------
  -;;;  (c) copyright 1998,1999 by Gilbert Baumann
  +;;;  (c) copyright 1998,1999,2003 by Gilbert Baumann
   ;;;  (c) copyright 2000 by 
   ;;;           Robert Strandh (strandh@labri.u-bordeaux.fr)
   
  
positive.code:                            (+ (* a2 c1) (* b2 f1) c2)
                             (+ (* d2 c1) (* e2 f1) f2) ))))
  
  (defmethod invert-transformation ((transformation standard-transformation))
    (with-slots (inverse) transformation
      (or inverse
          (let ((computed-inverse
                 (restart-case
                  (or
                   (handler-case (multiple-value-bind (mxx mxy myx myy tx ty) (get-transformation transformation)
                                   (let ((det (- (* mxx myy) (* myx mxy))))
                                     (if (coordinate= 0 det)
                                         nil
                                       (let ((/det (/ det)))
                                         (let ((mxx (* /det myy))
                                               (mxy (* /det (- mxy)))
                                               (myx (* /det (- myx)))
                                               (myy (* /det mxx)))
                                           (make-transformation mxx mxy myx myy
                                                                (+ (* -1 mxx tx) (* -1 mxy ty))
                                                                (+ (* -1 myx tx) (* -1 myy ty))))))))
                                 (error (c)
                                        (error 'singular-transformation :why c :transformation transformation)))
                   (error 'singular-transformation :transformation transformation))
                  (use-value (value)
                             :report (lambda (sink)
                                       (format sink "Supply a transformation to use instead of the inverse."))
                             value))))
            (setf (slot-value computed-inverse 'inverse) transformation)
            (setf inverse computed-inverse)
            computed-inverse))))
  
  (defun compose-translation-with-transformation (transformation dx dy)
    (compose-transformations (make-translation-transformation dx dy) transformation))
  
negative.code: 
  (defmacro with-scaling ((medium sx &optional sy origin) &body body)
    (if sy
        `(with-drawing-options (,medium :transformation (make-scaling-transformation
                                                         ,sx ,sy ,@(if origin (list origin) nil)))
           ,@body)
      (let ((sx-var (make-symbol "SX")))
        `(let* ((,sx-var ,sx))
  