From 4ed8512cac5445c758305fc3d1eb260a99ca1312 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 28 Oct 2021 20:33:32 +0300 Subject: [PATCH] - fixed printing a CNCJob object with File -> Print(PDF) functionality by adding a root element if both travels and cuts are present --- CHANGELOG.md | 1 + camlib.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e695556..28db4637 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta - cleaned the geometry generated by flattening by removing the empty geometry; fixed issue #539 on jpcgt's bitbucket account - fixed error that did not allowed printing from the TextEditor - added an error message when the File -> Print to PDF functionality is not working due of missing a root element in the SVG step +- fixed printing a CNCJob object with File -> Print(PDF) functionality by adding a root element if both travels and cuts are present 27.10.2021 diff --git a/camlib.py b/camlib.py index 9e4fa40a..1195284e 100644 --- a/camlib.py +++ b/camlib.py @@ -7688,6 +7688,10 @@ class CNCjob(Geometry): if cuts: svg_elem += cutsgeom.svg(scale_factor=scale_stroke_factor, stroke_color="#5E6CFF") + # if both are true then we need a root element + if travels and cuts: + svg_elem = "" + svg_elem + "" + return svg_elem def bounds(self, flatten=None):