On Sun, 02 Jan 2005 10:57:06 -0800, Jon A. Cruz <jon@...18...> wrote:
Hmmm....
The only question that comes to mind is wether or not the proper calculations were preserved.
:-)
I hope so. Please test :)
That is, since the magic literals were actually representing the ratio of user units to device pixels,
More precisely, of absolute units to user units (which we call px). User units, in their turn, can have non-1:1 ratio to device pixels, but that's another story, and is much less of a problem since this is supposed to happen on high-resolution devices only, not on screen.
at some point in the future (mainly once we tweak the CSS support), we'll probably want to go ahead and support unit ratios determined by the SVG user agent at initialization time as mentioned in the SVG spec. So... did you just refactor the code to remove those values altogether, or did you replace them with a variable or #define and then set that to 1.0?
Previously the widely used functions such as selection bbox, document width etc. all returned pt, but you needed px to write to repr, hence the conversions. Now all these functions return px, so no converstions are needed. Where conversions are needed (only where the user-selectable units are used), they are all done in a centralized way via SPUnit methods. So about the only place where the ratio is hardcoded is #define DEVICESCALE in unit-constants.h. I have left a couple 1.25s and 0.8s but this is because they are in the code which I don't understand and cannot test (specifically in extension/internal/win32.cpp and extension/internal/gnome.cpp).