EggBot icon indicating copy to clipboard operation
EggBot copied to clipboard

Hatch fill fail on viewbox issue

Open oskay opened this issue 4 years ago • 0 comments

Traceback (most recent call last):
  File "eggbot_hatch.py", line 32, in <module>
    exit_status.run(e.affect)
  File "/Users/student/Library/Application Support/org.inkscape.Inkscape/config/inkscape/extensions/axidraw_deps/ink_extensions_utils/exit_status.py", line 26, in run
    return func(*args, **kwargs)
  File "/Users/student/Library/Application Support/org.inkscape.Inkscape/config/inkscape/extensions/axidraw_deps/ink_extensions/inkex.py", line 291, in affect
    self.effect()
  File "/Users/student/Library/Application Support/org.inkscape.Inkscape/config/inkscape/extensions/axidraw_deps/axidrawinternal/eggbot_hatch.py", line 1214, in effect
    self.handleViewBox()
  File "/Users/student/Library/Application Support/org.inkscape.Inkscape/config/inkscape/extensions/axidraw_deps/axidrawinternal/eggbot_hatch.py", line 686, in handleViewBox
    sx = self.docWidth / float(vinfo[2])
ZeroDivisionError: float division by zero

The offending code:

            viewbox = self.document.getroot().get('viewBox')
            if viewbox:
                vinfo = viewbox.strip().replace(',', ' ').split(' ')
                if vinfo[2] != 0 and vinfo[3] != 0:
                    sx = self.docWidth / float(vinfo[2])
                    sy = self.docHeight / float(vinfo[3])

oskay avatar Nov 18 '21 21:11 oskay