lifelike / countersheetsextension

Inkscape extension for the layout of sheets of cards, tiles, or counters for boardgames.
Other
236 stars 27 forks source link

getDocumentUnit division by zero #45

Closed lifelike closed 5 years ago

lifelike commented 5 years ago

Reported by bgg user Jimmydm90 (using inkscape 0.92.2):

Traceback (most recent call last): File "countersheet.py", line 2025, in effect.affect() File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 265, in affect self.getposinlayer() File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 207, in getposinlayer x = self.unittouu( xattr[0] + 'px' ) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 351, in unittouu return retval (self.uuconv[u.string[u.start():u.end()]] / self.uuconv[self.getDocumentUnit()]) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 326, in getDocumentUnit svgunitfactor = self.__uuconv[svgwidthunit] width / viewboxwidth ZeroDivisionError: float division by zero

lifelike commented 5 years ago

Now falling back to using svg width or height if viewbox is missing (with automatic test added).