diff --git a/src/octoprint/plugins/svgtogcode/static/js/working_area.js b/src/octoprint/plugins/svgtogcode/static/js/working_area.js index 2c469b49..664b2ce6 100644 --- a/src/octoprint/plugins/svgtogcode/static/js/working_area.js +++ b/src/octoprint/plugins/svgtogcode/static/js/working_area.js @@ -274,10 +274,10 @@ $(function(){ newSvgAttrs['transform'] = scaleMatrixStr; var newSvg = snap.group(f.selectAll("svg>*")); - // var hasText = newSvg.selectAll('text,tspan'); - // if(hasText !== null && hasText.length > 0){ - // self.svg_contains_text_warning(newSvg); - // } + var hasText = newSvg.selectAll('text,tspan'); + if(hasText !== null && hasText.length > 0){ + self.svg_contains_text_warning(newSvg); + } newSvg.bake(); // remove transforms newSvg.selectAll('path').attr({strokeWidth: '0.5'}); @@ -397,15 +397,14 @@ $(function(){ }; self.svg_contains_text_warning = function(svg){ - // var error = "
" + gettext("The svg file contains text elements.
Please convert them to paths.
Otherwise they will be ignored.") + "
" + data.jqXHR.responseText + ""); - // new PNotify({ - // title: "Text elements found", - // text: error, - // type: "warn", - // hide: false - // }); - // svg.selectAll('text,tspan').remove(); + var error = "
" + gettext("The SVG file contains text elements.
If you want to laser just their outlines,
please convert them to paths.
Otherwise they will be engraved with infill.") + "
" + data.jqXHR.responseText + ""); + new PNotify({ + title: "Text elements found", + text: error, + type: "warn", + hide: false + }); }; self.svg_misfitting_warning = function(svg, misfitting){