From 9795f90529c998f1961af347b7af17b29bcf3161 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Tue, 19 Oct 2021 16:06:48 +0200 Subject: [PATCH] fix in barrel distortion --- .../fablabchemnitz/barrel_distorsion/barrel_distorsion.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/fablabchemnitz/barrel_distorsion/barrel_distorsion.py b/extensions/fablabchemnitz/barrel_distorsion/barrel_distorsion.py index 107ecf84..4b2bcbb1 100644 --- a/extensions/fablabchemnitz/barrel_distorsion/barrel_distorsion.py +++ b/extensions/fablabchemnitz/barrel_distorsion/barrel_distorsion.py @@ -67,6 +67,9 @@ class BarrelDistorsion(inkex.EffectExtension): if node.tag == inkex.addNS('path', 'svg'): path = Path(node.get('d')).to_arrays() nodes += path + if len(nodes) == 0: + inkex.utils.debug("Selection is invalid. Please change selection to paths only.") + exit(1) nodes_filtered = [x for x in nodes if x[0] != 'Z'] x_coordinates = [x[-1][-2] for x in nodes_filtered] y_coordinates = [y[-1][-1] for y in nodes_filtered]