From aca3ed67a2411b5c87203a768ab156661beab238 Mon Sep 17 00:00:00 2001 From: jnighlight Date: Mon, 17 Sep 2012 00:34:55 -0400 Subject: [PATCH] Cleaned up ExportSVG for general purpose. Removed all lines written for testing purposes, saved them in a text document for possible future reference. Code should look a lot more clean and linear with all the stuff removed. --- src/svg/ExportSVG.js | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/svg/ExportSVG.js b/src/svg/ExportSVG.js index 68d35811..26168ee9 100644 --- a/src/svg/ExportSVG.js +++ b/src/svg/ExportSVG.js @@ -92,23 +92,11 @@ var ExportSVG = function() { //this.initialize(); //console.log(blarg.svgObj); + var pathClone = path.clone(); var NS = "http://www.w3.org/2000/svg"; svgObj = document.createElementNS(NS,"svg"); - svgRect = document.createElementNS(NS,"rect"); - svgRect.height.baseVal.value = 50; - svgRect.width.baseVal.value = 60; - svgRect.x.baseVal.value = 50; - svgObj.appendChild(svgRect); - - svgPoint = document.createElementNS(NS,"point"); - svgPoint.setAttribute("x",50); - svgPoint.setAttribute("y",100); - svgObj.appendChild(svgPoint); - svgPath = document.createElementNS(NS, "path"); - - console.log(svgObj); - var pathClone = path.clone(); + var segArray = pathClone.getSegments(); var pointArray = new Array(); @@ -120,10 +108,6 @@ var ExportSVG = function() pointArray[i] = segArray[i].getPoint(); handleInArray[i] = segArray[i].getHandleIn(); handleOutArray[i] = segArray[i].getHandleOut(); - - console.log("point " + i + ": " + pointArray[i]); - console.log("HI " + i + ": " + handleInArray[i]); - console.log("HO " + i + ": " + handleOutArray[i]); } var pointString = ""; for(i = 0; i < pointArray.length; i++) @@ -165,14 +149,8 @@ var ExportSVG = function() var fillRGB = RGBtoHex(fillRed, fillGreen, fillBlue); svgPath.setAttribute("fill", fillRGB); } - - //svgPath.setAttribute("d", pointString); - //svgPath.setAttribute("stroke", strokeRGB); - //svgPath.setAttribute("fill", fillRGB); svgPath.setAttribute("stroke-width",pathClone.strokeWidth); svgObj.appendChild(svgPath); - - console.log(svgObj); return svgObj; };