[mcclim-cvs] CVS mcclim

dlichteblau dlichteblau at common-lisp.net
Sun Jul 15 12:38:38 UTC 2007


Update of /project/mcclim/cvsroot/mcclim
In directory clnet:/tmp/cvs-serv10361

Modified Files:
	recording.lisp 
Log Message:
Fixed bug reported by Fred Gilham, [mcclim-devel] Tooltip stuff

	* recording.lisp (erase-output-record): Lock the bounding
        rectangle to the pixel grid and add extra safety at the borders
        to avoid leaving fragments on the border.


--- /project/mcclim/cvsroot/mcclim/recording.lisp	2007/06/03 18:47:03	1.132
+++ /project/mcclim/cvsroot/mcclim/recording.lisp	2007/07/15 12:38:37	1.133
@@ -2048,10 +2048,20 @@
      when (eq parent nil) do (return nil)
      when (eq parent ancestor) do (return t)))
 
+(defun rounded-bounding-rectangle (region)
+  ;; return a bounding rectangle whose coordinates have been rounded to
+  ;; lock into the pixel grid.  Includes some extra safety to make
+  ;; sure antialiasing around the theoretical limits are included, too.
+  (with-bounding-rectangle* (x1 y1 x2 y2) region
+    (make-rectangle*  (floor (- x1 0.5))
+		      (floor (- y1 0.5))
+		      (ceiling (+ x2 0.5))
+		      (ceiling (+ y2 0.5)))))
+
 (defmethod erase-output-record (record (stream standard-output-recording-stream)
                                 &optional (errorp t))
   (letf (((stream-recording-p stream)  nil))
-    (let ((region (bounding-rectangle record)))
+    (let ((region (rounded-bounding-rectangle record)))
       (with-bounding-rectangle* (x1 y1 x2 y2) region
         (if (output-record-ancestor-p (stream-output-history stream) record)
             (progn




More information about the Mcclim-cvs mailing list