From 07bafed37e9cdf4d3c4640bb31e6e416b20bbd3a Mon Sep 17 00:00:00 2001 From: Teja Date: Tue, 13 Oct 2015 18:19:05 +0200 Subject: [PATCH] removed debug coloring, cleanup works --- .../svgtogcode/static/js/working_area.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/octoprint/plugins/svgtogcode/static/js/working_area.js b/src/octoprint/plugins/svgtogcode/static/js/working_area.js index aead76fb..9fc51fb6 100644 --- a/src/octoprint/plugins/svgtogcode/static/js/working_area.js +++ b/src/octoprint/plugins/svgtogcode/static/js/working_area.js @@ -412,7 +412,7 @@ $(function(){ newImg.attr({id: previewId, filter: 'url(#grayscale_filter)', 'data-serveurl': url}); snap.select("#userContent").append(newImg); newImg.transformable(); - newImg.ftDisableRotate(); + //newImg.ftDisableRotate(); newImg.ftRegisterCallback(self.svgTransformUpdate); file.id = id; file.previewId = previewId; @@ -630,13 +630,14 @@ $(function(){ var wPT = wMM * 90 / 25.4; var hPT = hMM * 90 / 25.4; var compSvg = Snap(wPT, hPT); - compSvg.attr('id', 'tmpSvg'); + compSvg.attr('id', 'compSvg'); var userContent = snap.select("#userContent").clone(); compSvg.append(userContent); self.renderInfill(compSvg, wMM, hMM, 10, function(){ callback( self._wrapInSvgAndScale(compSvg)); + $('#compSvg').remove(); }); }; @@ -797,15 +798,17 @@ $(function(){ } var cb = function(result) { - svg.selectAll('image').remove(); - var waBB = snap.select('#coordGrid').getBBox(); - var fillImage = snap.image(result, 0, 0, waBB.w, waBB.h); - fillImage.attr('id', 'fillRendering'); - svg.append(fillImage); - + if(fillings.length > 0){ + svg.selectAll('image').remove(); + var waBB = snap.select('#coordGrid').getBBox(); + var fillImage = snap.image(result, 0, 0, waBB.w, waBB.h); + fillImage.attr('id', 'fillRendering'); + svg.append(fillImage); + } if (typeof callback === 'function') { callback(svg); } + self._cleanup_render_mess(); }; tmpSvg.renderPNG(wMM, hMM, pxPerMM, cb);