From 1cdb3538a83a13d97907d08908750f0d85de6978 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 15 Jan 2023 20:04:10 +0100 Subject: Add bean stitch repeat pattern (#1938) ! backward compatibility warning: Users need to fix their documents if they used comma separated values for multiple fill underlays (without a space) --- lib/elements/element.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/elements/element.py') diff --git a/lib/elements/element.py b/lib/elements/element.py index 75f9fc10..692d8228 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -162,6 +162,16 @@ class EmbroideryElement(object): def get_split_mm_param_as_px(self, param, default): return self.get_split_float_param(param, default) * PIXELS_PER_MM + # returns an array of multiple space separated int values + @cache + def get_multiple_int_param(self, param, default="0"): + params = self.get_param(param, default).split(" ") + try: + params = [int(param) for param in params] + except (TypeError, ValueError): + return [default] + return params + def set_param(self, name, value): # Sets a param on the node backing this element. Used by params dialog. # After calling, this element is invalid due to caching and must be re-created to use the new value. -- cgit v1.2.3