[mcclim-cvs] CVS update: mcclim/recording.lisp

Clemens Fruhwirth cfruhwirth at common-lisp.net
Fri Jan 13 12:18:15 UTC 2006


Update of /project/mcclim/cvsroot/mcclim
In directory common-lisp.net:/tmp/cvs-serv18663

Modified Files:
	recording.lisp 
Log Message:
%handle-repaint derives the bounding rectangle for region. There are 
two cases where region does not participate in the bounding rectangle 
protocol: +everywhere+ and +nowhere+, the only two regions in the 
unbound region class. For +everywhere+, fallback to the bounding 
rectangle of sheet. For +nowhere+, ignore repaint.

Date: Fri Jan 13 13:18:11 2006
Author: cfruhwirth

Index: mcclim/recording.lisp
diff -u mcclim/recording.lisp:1.120 mcclim/recording.lisp:1.121
--- mcclim/recording.lisp:1.120	Thu Dec  1 12:10:55 2005
+++ mcclim/recording.lisp	Fri Jan 13 13:17:55 2006
@@ -2237,11 +2237,14 @@
 
 (defun %handle-repaint (stream region)
   (when (output-recording-stream-p stream)
-    (let ((region (bounding-rectangle region)))
-      (with-bounding-rectangle* (x1 y1 x2 y2) region
-        (with-output-recording-options (stream :record nil)
-          (draw-rectangle* stream x1 y1 x2 y2 :filled T :ink +background-ink+)))
-      (stream-replay stream region))))
+    (unless (region-equal region +nowhere+)                    ; ignore repaint requests for +nowhere+
+      (let ((region (if (region-equal region +everywhere+)
+			(sheet-region stream)                  ; fallback to the sheet's region for +everwhere+
+		      (bounding-rectangle region))))
+	(with-bounding-rectangle* (x1 y1 x2 y2) region
+	  (with-output-recording-options (stream :record nil)
+	    (draw-rectangle* stream x1 y1 x2 y2 :filled T :ink +background-ink+)))
+	(stream-replay stream region)))))
 
 (defmethod handle-repaint ((stream output-recording-stream) region)
   (%handle-repaint stream region))




More information about the Mcclim-cvs mailing list