Skip to content

Hatch fill fail on viewbox issue #168

@oskay

Description

@oskay
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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions