diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-07-14 16:23:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-14 16:23:46 +0200 |
| commit | 4f7cd2885f4d0e725b33c919ef655af0240948cb (patch) | |
| tree | a250a2f6159e3f3690bab3a6d33be44581ed8d52 | |
| parent | e23997ed1c79e35c1bbaff61721ef0851737b990 (diff) | |
Some updates for small issues in v2.2.0 (#1721)
* * autorun - underpath tolerance
* save pdf file format
* fill no geoms error for linestring
* to satin: do not fail on mixed element list
| -rw-r--r-- | electron/src/main/index.js | 4 | ||||
| -rw-r--r-- | lib/elements/fill_stitch.py | 2 | ||||
| -rw-r--r-- | lib/extensions/convert_to_satin.py | 5 | ||||
| -rw-r--r-- | lib/stitches/auto_run.py | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/electron/src/main/index.js b/electron/src/main/index.js index 09fd2959..d6f259fe 100644 --- a/electron/src/main/index.js +++ b/electron/src/main/index.js @@ -80,7 +80,9 @@ app.on('activate', () => { ipcMain.on('save-pdf', function (event, pageSize) { mainWindow.webContents.printToPDF({"pageSize": pageSize}, function(error, data) { - dialog.showSaveDialog(mainWindow, {"defaultPath": "inkstitch.pdf"}, function(filename, bookmark) { + dialog.showSaveDialog(mainWindow, {"defaultPath": "inkstitch.pdf", + "filters": [{ name: 'PDF', extensions: ['pdf'] }] + }, function(filename, bookmark) { if (typeof filename !== 'undefined') fs.writeFileSync(filename, data, 'utf-8'); }) diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index a0ab0d33..ad2b5372 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -269,6 +269,8 @@ class FillStitch(EmbroideryElement): if isinstance(valid_shape, shgeo.Polygon): return shgeo.MultiPolygon([valid_shape]) + if isinstance(valid_shape, shgeo.LineString): + return shgeo.MultiPolygon([]) polygons = [] for polygon in valid_shape.geoms: diff --git a/lib/extensions/convert_to_satin.py b/lib/extensions/convert_to_satin.py index 9950b2e8..93850789 100644 --- a/lib/extensions/convert_to_satin.py +++ b/lib/extensions/convert_to_satin.py @@ -35,12 +35,15 @@ class ConvertToSatin(InkstitchExtension): inkex.errormsg(_("Please select at least one line to convert to a satin column.")) return - if not all(isinstance(item, Stroke) for item in self.elements): + if not any(isinstance(item, Stroke) for item in self.elements): # L10N: Convert To Satin extension, user selected one or more objects that were not lines. inkex.errormsg(_("Only simple lines may be converted to satin columns.")) return for element in self.elements: + if not isinstance(element, Stroke): + continue + parent = element.node.getparent() index = parent.index(element.node) correction_transform = get_correction_transform(element.node) diff --git a/lib/stitches/auto_run.py b/lib/stitches/auto_run.py index ab5762a3..ff26eb16 100644 --- a/lib/stitches/auto_run.py +++ b/lib/stitches/auto_run.py @@ -270,6 +270,7 @@ def create_element(path, position, direction, element): # Set Ink/Stitch attributes stitch_length = element.node.get(INKSTITCH_ATTRIBS['running_stitch_length_mm'], '') + tolerance = element.node.get(INKSTITCH_ATTRIBS['running_stitch_tolerance_mm'], '') repeats = int(element.node.get(INKSTITCH_ATTRIBS['repeats'], 1)) if repeats % 2 == 0: repeats -= 1 @@ -284,6 +285,8 @@ def create_element(path, position, direction, element): else: if stitch_length: node.set(INKSTITCH_ATTRIBS['running_stitch_length_mm'], stitch_length) + if tolerance: + node.set(INKSTITCH_ATTRIBS['running_stitch_tolerance_mm'], tolerance) node.set("style", element.node.style + inkex.Style("stroke-dasharray:0.5,0.5;fill:none;")) return Stroke(node) |
