[mcclim-cvs] CVS mcclim/Backends/CLX
dlichteblau
dlichteblau at common-lisp.net
Sun Nov 5 15:35:26 UTC 2006
Update of /project/mcclim/cvsroot/mcclim/Backends/CLX
In directory clnet:/tmp/cvs-serv5740
Modified Files:
port.lisp
Log Message:
Magic number elimination #1:
Remove the 100px default for mirror width and height.
Old algorithm was:
* Use cached sheet-mirror-region if present.
* Else use keyword argument if given.
* Else use default argument value 100.
(The third code path was actually being used.)
New algorithm:
* Use keyword argument if given.
* Else use cached sheet-mirror-region.
--- /project/mcclim/cvsroot/mcclim/Backends/CLX/port.lisp 2006/10/29 08:29:46 1.123
+++ /project/mcclim/cvsroot/mcclim/Backends/CLX/port.lisp 2006/11/05 15:35:26 1.124
@@ -337,7 +337,7 @@
mirror-region)))
(defun realize-mirror-aux (port sheet
- &key (width 100) (height 100) (x 0) (y 0)
+ &key width height (x 0) (y 0)
(border-width 0) (border 0)
(override-redirect :off)
(map t)
@@ -367,12 +367,10 @@
(pixel (xlib:alloc-color (xlib:screen-default-colormap (clx-port-screen port)) color))
(window (xlib:create-window
:parent (sheet-mirror (sheet-parent sheet))
- :width (if (%sheet-mirror-region sheet)
- (round-coordinate (bounding-rectangle-width (%sheet-mirror-region sheet)))
- width)
- :height (if (%sheet-mirror-region sheet)
- (round-coordinate (bounding-rectangle-height (%sheet-mirror-region sheet)))
- height)
+ :width (or width
+ (round-coordinate (bounding-rectangle-width (%sheet-mirror-region sheet))))
+ :height (or height
+ (round-coordinate (bounding-rectangle-height (%sheet-mirror-region sheet))))
:x (if (%sheet-mirror-transformation sheet)
(round-coordinate (nth-value 0 (transform-position
(%sheet-mirror-transformation sheet)
More information about the Mcclim-cvs
mailing list