
thanx for your explanation, understood and changed in my code.
but i have another problem:
the code of unittouu defaults to px when no uu was directly specified:
else: # default assume 'px' unit return retval / self.__uuconv[self.getDocumentUnit()]
so with a unit (e.g. "200mm") i get mm, without a unit (e.g. "200" when inkscape:document-units="mm") i get px.
this can't be right, can it?
regards, TimeWaster
On 17.11.2013 23:29, Johan Engelen wrote:
On 17-11-2013 17:45, TimeWaster wrote:
hi,
i think with the change from inkex.unittouu to Effect.unittouu in inkex.py (r12722) was a bug introduced (regression).
am i right that a user unit is equivalent to a pixel?
It's a little different. In the trunk version, we set the viewbox according to the user selected document unit, so that the SVG values are expressed in the document unit. The document unit == user unit, or what the extension should output. The uuconv table is really an internal conversion table, and should not be used by extensions. I do not know much about python. Perhaps we can simply make the uuconv table private, so no-one is going to use it outside of inkex.py.
regards, Johan
if yes, the actual implementation is converting to *something* but not to user units.
i think the code should look like this (or the method should be renamed to something other than *touu):
if u: try: return retval *
self.uuconv[u.string[u.start():u.end()]] except KeyError: pass else: # default take document unit return retval * self.uuconv[self.getDocumentUnit()]
can somebody confirm this?
its also the same with uutounit, it should be:
def uutounit(self, val, unit): return val / self.uuconv[unit]
regards, TimeWaster
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel