[ Sorry to send this message to the scsh-bugs mailing list, but
wandy@mit.edu seems not a valid address any more, and maybe someone
on the list is able to get things addressed to the right person. ]
It seems to me that bounding-box suffers from a bug that shows up only
in some circumstances.
Here is a sample session to reproduce the bug:
> ,config ,load fps-package.scm
fps-package.scm ......
> ,in fps
Load structure program (y/n)? y
[elided stuff]
> (define l (line (pt 0 0) (pt 3 3)))
> (bounding-box (translate 0 10 (translate 10 0 l)))
'#{bbox #{pt 10 10} #{pt 13 13}}
> (define a (translate 0 10 l))
> (bounding-box a)
'#{bbox #{pt 0 10} #{pt 3 13}}
> (define b (translate 10 0 a))
> (bounding-box b)
'#{bbox #{pt 0 10} #{pt 3 13}}
The last result should have been:
'#{bbox #{pt 10 10} #{pt 13 13}}
Here is a patch that solves the problem:
diff -c fps.ask.scm\~ fps.ask.scm
*** fps.ask.scm~ Thu Oct 31 20:07:18 1996
--- fps.ask.scm Sun Apr 20 00:21:23 2003
***************
*** 37,43 ****
((close-path? obj) (loop (close-path:path obj) TM))
((stroke-outline-path? obj) (loop (stroke-outline-path:path obj)
TM))
! ((instance? obj) (or (instance:bbox obj)
(let ((box (loop (instance:obj obj)
(matrix* (instance:TM
obj)
TM))))
--- 37,44 ----
((close-path? obj) (loop (close-path:path obj) TM))
((stroke-outline-path? obj) (loop (stroke-outline-path:path obj)
TM))
! ((instance? obj) (if (instance:bbox obj)
! (transform-bbox TM (instance:bbox obj))
(let ((box (loop (instance:obj obj)
(matrix* (instance:TM
obj)
TM))))
***************
*** 49,55 ****
((composite? obj) (composite-bbox obj TM))
((clipped? obj) (clipped-bbox obj TM))
((bitmap-pict? obj) (bitmap-pict-bbox obj TM))
! ((instance? obj) (or (instance:bbox obj)
(let ((box (loop (instance:obj obj)
(matrix* (instance:TM
obj)
TM))))
--- 50,57 ----
((composite? obj) (composite-bbox obj TM))
((clipped? obj) (clipped-bbox obj TM))
((bitmap-pict? obj) (bitmap-pict-bbox obj TM))
! ((instance? obj) (if (instance:bbox obj)
! (transform-bbox TM (instance:bbox obj))
(let ((box (loop (instance:obj obj)
(matrix* (instance:TM
obj)
TM))))
--
walter pelissero
http://members.lycos.co.uk/wpelissero
|