Comment 5 for bug 1654907

Revision history for this message
su_v (suv-lp) wrote :

@Pelle - the extension 'Visualize > Measure' AFAICT is one of the bundled extensions which does support arbitrary document scale:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/view/15320/share/extensions/measure.py#L214
measure.py does not rely on methods from inkex.py to determine the document scale stored in the 'factor' variable (page dimension / viewBox dimension) - not an ideal solution either, IMvHO. Personally, I still think that the unit conversion methods provided for the Effect() class in inkex.py should support arbitrary document scales, even if I retracted my originally proposed implementation (the issue is not solved).

The code as originally proposed for (closed) bug #1508400 is still in use for example in these custom, externally hosted extensions:
* https://gitlab.com/su-v/inx-exportcoords
* https://gitlab.com/su-v/inx-exportobjects
They have a compatibility class for Effect() with a new get_document_scale() method, which is used by overloaded unittouu() and uutounit() methods. The code called by get_document_scale() is rather dated, and I probably would change parts of it based on what I have learned since.