mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Made changes to SVGCircles to be able to have an easier time reading the
data from the circle. Also, made an SVGRect html to test rectangles. No other changes than that. Still working on telling the types of points from Paths that we make. The curveTo's and arcTo's are giving us the most trouble. LineTo's are points with 0 values for the handles. Jacob will clean up the code for the walkthrough tomorrow. There we can figure out how to solve this problem and hopefully finish up the exportPath method.
This commit is contained in:
parent
f43abe2f32
commit
b582e96d76
1 changed files with 5 additions and 4 deletions
|
@ -115,7 +115,8 @@ var ExportSVG = function()
|
|||
var handleInArray = new Array();
|
||||
var handleOutArray = new Array();
|
||||
for(i = 0; i < segArray.length; i++)
|
||||
{
|
||||
{
|
||||
console.log(segArray[i].toString());
|
||||
pointArray[i] = segArray[i].getPoint();
|
||||
handleInArray[i] = segArray[i].getHandleIn();
|
||||
handleOutArray[i] = segArray[i].getHandleOut();
|
||||
|
@ -128,9 +129,9 @@ var ExportSVG = function()
|
|||
for(i = 0; i < pointArray.length; i++)
|
||||
{
|
||||
var x = pointArray[i].getX();
|
||||
x = x - (x % 1);
|
||||
//x = x - (x % 1);
|
||||
var y = pointArray[i].getY();
|
||||
y = y - (y % 1);
|
||||
//y = y - (x % 1);
|
||||
if(i === 0)
|
||||
{
|
||||
pointString+= "M " + x + " " + y + " ";
|
||||
|
@ -169,7 +170,7 @@ var ExportSVG = function()
|
|||
//svgPath.setAttribute("stroke", strokeRGB);
|
||||
//svgPath.setAttribute("fill", fillRGB);
|
||||
svgPath.setAttribute("stroke-width",pathClone.strokeWidth);
|
||||
svgObj.appendChild(svgPath);i
|
||||
svgObj.appendChild(svgPath);
|
||||
|
||||
console.log(svgObj);
|
||||
return svgObj;
|
||||
|
|
Loading…
Reference in a new issue