[mcclim-cvs] CVS update: mcclim/Backends/CLX/port.lisp

Timothy Moore tmoore at common-lisp.net
Fri Jan 14 12:43:31 UTC 2005


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

Modified Files:
	port.lisp 
Log Message:
Change ROUND-COORDINATES back to the definition that rounds up at half pixel boundaries. When I made the previous change I didn't realize that X coordinates are at pixel centers.
Date: Fri Jan 14 13:43:25 2005
Author: tmoore

Index: mcclim/Backends/CLX/port.lisp
diff -u mcclim/Backends/CLX/port.lisp:1.103 mcclim/Backends/CLX/port.lisp:1.104
--- mcclim/Backends/CLX/port.lisp:1.103	Tue Jan 11 14:35:33 2005
+++ mcclim/Backends/CLX/port.lisp	Fri Jan 14 13:43:25 2005
@@ -34,9 +34,11 @@
   ;; Using CL:ROUND gives you "random" results. Using "mercantile
   ;; rounding" gives you consistent results.
   ;;
-  ;; For values at .5 we round down in order to be consistant with
-  ;; the CLIM and CLX definitions for pixel coverage of shapes.
-  (ceiling (- x .5)))
+  ;; Note that CLIM defines pixel coordinates to be at the corners,
+  ;; while in X11 they are at the centers. We don't do much about the
+  ;; discrepancy, but rounding down at half pixel boundaries seems to
+  ;; work well.
+  (floor (+ x .5)))
 
 ;;; CLX-PORT class
 




More information about the Mcclim-cvs mailing list