- fixed printing a CNCJob object with File -> Print(PDF) functionality by adding a root element if both travels and cuts are present

This commit is contained in:
Marius Stanciu
2021-10-28 20:33:32 +03:00
committed by Marius Stanciu
parent de4c51b480
commit 4ed8512cac
2 changed files with 5 additions and 0 deletions

View File

@@ -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 - 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 - 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 - 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 27.10.2021

View File

@@ -7688,6 +7688,10 @@ class CNCjob(Geometry):
if cuts: if cuts:
svg_elem += cutsgeom.svg(scale_factor=scale_stroke_factor, stroke_color="#5E6CFF") svg_elem += cutsgeom.svg(scale_factor=scale_stroke_factor, stroke_color="#5E6CFF")
# if both are true then we need a root element <g>
if travels and cuts:
svg_elem = "<g>" + svg_elem + "</g>"
return svg_elem return svg_elem
def bounds(self, flatten=None): def bounds(self, flatten=None):