Added forgotten bool option

This commit is contained in:
Mario Voigt 2020-12-16 15:32:29 +01:00
parent 02c98d0b79
commit 171133fa7f

View File

@ -26,7 +26,7 @@ class Cleanup(inkex.Effect):
inkex.Effect.__init__(self) inkex.Effect.__init__(self)
self.arg_parser.add_argument("--stroke_width", type=float, default=0.1, help="Stroke width") self.arg_parser.add_argument("--stroke_width", type=float, default=0.1, help="Stroke width")
self.arg_parser.add_argument("--stroke_units", default="mm", help="Stroke unit") self.arg_parser.add_argument("--stroke_units", default="mm", help="Stroke unit")
self.arg_parser.add_argument("--remove_styles", default="mm", help="Remove stroke styles") self.arg_parser.add_argument("--remove_styles", type=inkex.Boolean, help="Remove stroke styles")
self.arg_parser.add_argument("--opacity", type=float, default="100.0", help="Opacity") self.arg_parser.add_argument("--opacity", type=float, default="100.0", help="Opacity")
def effect(self): def effect(self):
@ -57,6 +57,7 @@ class Cleanup(inkex.Effect):
if prop == 'stroke-opacity': if prop == 'stroke-opacity':
new_val = str(self.options.opacity / 100) new_val = str(self.options.opacity / 100)
declarations[i] = prop + ':' + new_val declarations[i] = prop + ':' + new_val
if self.options.remove_styles == True:
if prop == 'stroke-dasharray': if prop == 'stroke-dasharray':
declarations[i] = '' declarations[i] = ''
if prop == 'stroke-dashoffset': if prop == 'stroke-dashoffset':