def subpath_element(event): context = element.parent if isinstance(element, PathElement): element.detach() path = Path() svg_parser.parse_svg_path(path, element.path) add = [] for subpath in path.as_subpaths(): subelement = PathElement(subpath.d()) subelement.properties.update(element.properties) subelement.matrix = Matrix(element.matrix) add.append(subelement) context.append_all(add) project.set_selected(None)
def parse_path(pathd): parser = Path() svg_parser.parse_svg_path(parser, pathd) return parser