On Thu, 25 Oct 2007, Franz Korntner wrote:
I feel that zooming should be
done by the plotters, not by the layout/renderer. Besides, delaying scaling
increases accuracy.
Yes, absolutely. It also means that the layout/rendering code can just
work with normal ints and have more than enough bits to handle even
very long HTML files. Your alternative approach of using fixed-point
arithmetic to keep the scaling in the rendering code would probably
run into trouble with exceptionally long files and a usable range of
only 2^18.
However, if we use normal unscaled co-ordinates throughout the renderer
and then, having already clipped to the visible area (at least for
screen output*) this is well below 2^18 currently) and then use
fixed-point arithmetic for zooming in the plotters. I'd suggest using
22.10 (or maybe just 24.8) for the plotter arithmetic since the scale
factor can only be set to n%.
Certainly it'd be great to finally eliminate the floating-point
arithmetic (this has been on my wishlist for a long time), so if you
already have a patch to do this, that's great.
Adrian
*Of course any plotters required to cope with the entirety of a long
page can simply use 64-bit quantities when they perform their scaling
and take the performance hit.