summaryrefslogtreecommitdiff
path: root/lib/elements/element.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2023-01-15 20:04:10 +0100
committerGitHub <noreply@github.com>2023-01-15 20:04:10 +0100
commit1cdb3538a83a13d97907d08908750f0d85de6978 (patch)
treeddccf347d43ff850f4e8eca0e4c541dbd3cf2e4f /lib/elements/element.py
parent4156c4adb4eadaf024b29df1df6bf1c91d3777a8 (diff)
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)
Diffstat (limited to 'lib/elements/element.py')
-rw-r--r--lib/elements/element.py10
1 files changed, 10 insertions, 0 deletions
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.