mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Rename SVG to Svg to follow naming convention.
This commit is contained in:
parent
6b50641c18
commit
160095d6e3
23 changed files with 78 additions and 78 deletions
|
@ -28,7 +28,7 @@
|
|||
var path = new Path.Circle(new Point(50, 50), 25);
|
||||
path.fillColor = 'red';
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -23,7 +23,7 @@
|
|||
path2.strokeColor = 'yellow';
|
||||
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -37,7 +37,7 @@
|
|||
line3.strokeColor = "yellow";
|
||||
line3.strokeWidth = "5";
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -35,7 +35,7 @@
|
|||
var path = new Path.Star(center, points, radius1, radius2);
|
||||
path.fillColor = 'black';
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -49,7 +49,7 @@
|
|||
path4.strokeColor= 'yellow';
|
||||
path4.fillColor='purple';
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -35,7 +35,7 @@
|
|||
c.fillColor = colors[i];
|
||||
}
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
var test = document.getElementById('svg')
|
||||
test.innerHTML = "";
|
|
@ -25,7 +25,7 @@
|
|||
clonedPath.rotate(angle * i, circlePath.bounds.topLeft);
|
||||
};
|
||||
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
console.log(output);
|
||||
var test = document.getElementById('svg')
|
|
@ -21,7 +21,7 @@
|
|||
copy.strokeColor = 'red';
|
||||
copy.rotate(-45);
|
||||
copy.scale(0.5);
|
||||
var esvg = new ExportSVG();
|
||||
var esvg = new ExportSvg();
|
||||
var output = esvg.exportProject(paper.project);
|
||||
var test = document.getElementById('svg')
|
||||
test.innerHTML = "";
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -12,7 +12,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -11,7 +11,7 @@
|
|||
// strokeWidth: 2,
|
||||
// strokeCap: 'round'
|
||||
};
|
||||
var isvg = new ImportSVG;
|
||||
var isvg = new ImportSvg;
|
||||
isvg.importSVG(document.getElementById('svg'));
|
||||
</script>
|
||||
</head>
|
|
@ -93,8 +93,8 @@ var paper = new function() {
|
|||
/*#*/ include('text/TextItem.js');
|
||||
/*#*/ include('text/PointText.js');
|
||||
|
||||
/*#*/ include('svg/ExportSVG.js');
|
||||
/*#*/ include('svg/ImportSVG.js');
|
||||
/*#*/ include('svg/ExportSvg.js');
|
||||
/*#*/ include('svg/ImportSvg.js');
|
||||
|
||||
/*#*/ include('style/Style.js');
|
||||
/*#*/ include('style/PathStyle.js');
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
|
||||
|
||||
/**
|
||||
* @name ExportSVG
|
||||
* @name ExportSvg
|
||||
*
|
||||
* @class The ExportSVG object represents a Paper.js object that will be
|
||||
* @class The ExportSvg object represents a Paper.js object that will be
|
||||
* converted into an SVG canvas design.
|
||||
* The Paper.js object is converted by changing its items into groups
|
||||
*
|
||||
*/
|
||||
|
||||
var ExportSVG = this.ExportSVG = Base.extend(/** @Lends ExportSVG# */{
|
||||
var ExportSvg = this.ExportSvg = Base.extend(/** @Lends ExportSvg# */{
|
||||
//initialize the svgObj
|
||||
initialize: function() {
|
||||
this.NS = 'http://www.w3.org/2000/svg';
|
||||
|
@ -60,7 +60,7 @@ var ExportSVG = this.ExportSVG = Base.extend(/** @Lends ExportSVG# */{
|
|||
* Takes the selected Paper.js layer and parses all groups
|
||||
* and items on the layer into one SVG
|
||||
*
|
||||
* @name ExportSVG#exportLayer
|
||||
* @name ExportSvg#exportLayer
|
||||
* @function
|
||||
* @param {Paper.js Layer} layer A Paper.js layer
|
||||
* @return {SVG DOM} this.exportGroup(layer) The layer converted into an
|
||||
|
@ -74,7 +74,7 @@ var ExportSVG = this.ExportSVG = Base.extend(/** @Lends ExportSVG# */{
|
|||
*
|
||||
* Takes a Paper.js group and puts its items in a SVG file.
|
||||
*
|
||||
* @name ExportSVG#exportGroup
|
||||
* @name ExportSvg#exportGroup
|
||||
* @function
|
||||
* @param {Paper.js Group} group A Paper.js group
|
||||
* @return {SVG DOM} svgG An SVG object
|
||||
|
@ -99,7 +99,7 @@ var ExportSVG = this.ExportSVG = Base.extend(/** @Lends ExportSVG# */{
|
|||
* Takes the path and puts it in
|
||||
* a svg file.
|
||||
*
|
||||
* @name ExportSVG#exportPath
|
||||
* @name ExportSvg#exportPath
|
||||
* @function
|
||||
* @param {Paper.js Path} path A Paper.js path object
|
||||
* @return {SVG DOM} svgPath An SVG object of the imported path
|
||||
|
@ -396,7 +396,7 @@ var ExportSVG = this.ExportSVG = Base.extend(/** @Lends ExportSVG# */{
|
|||
/**
|
||||
* Checks the type SVG object created by converting from Paper.js
|
||||
*
|
||||
* @name ExportSVG#checkType
|
||||
* @name ExportSvg#checkType
|
||||
* @function
|
||||
* @param {SVG Object Array} segArray An array of objects for the newly
|
||||
* converted SVG object
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @name ImportSVG
|
||||
* @class The ImportSVG object represents an object created using the SVG
|
||||
* @name ImportSvg
|
||||
* @class The ImportSvg object represents an object created using the SVG
|
||||
* Canvas that will be converted into a Paper.js object.
|
||||
* The SVG object is imported into Paper.js by converting it into items
|
||||
* within groups.
|
||||
*
|
||||
*/
|
||||
|
||||
var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
||||
var ImportSvg = this.ImportSvg = Base.extend(/** @Lends ImportSvg# */{
|
||||
/**
|
||||
* Creates a Paper.js object using data parsed from the selected
|
||||
* SVG Document Object Model (DOM). The SVG object is imported,
|
||||
|
@ -89,7 +89,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* Creates a Paper.js group by parsing a specific GNode of the
|
||||
* imported SVG DOM
|
||||
*
|
||||
* @name ImportSVG#importGroup
|
||||
* @name ImportSvg#importGroup
|
||||
* @function
|
||||
* @param {XML DOM} svg A node passed in by the imported SVG
|
||||
* @return {Group} group A Paper.js group
|
||||
|
@ -117,7 +117,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* Creates a Path.Circle item in Paper.js using an imported
|
||||
* Circle from SVG
|
||||
*
|
||||
* @name ImportSVG#importCircle
|
||||
* @name ImportSvg#importCircle
|
||||
* @function
|
||||
* @param {XML DOM} svgCircle An SVG circle node
|
||||
* @return {Path.Circle} circle A Path.Circle item for Paper.js
|
||||
|
@ -136,7 +136,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
/**
|
||||
* Creates a Path.Oval item in Paper.js using an imported Oval from SVG
|
||||
*
|
||||
* @name ImportSVG#importOval
|
||||
* @name ImportSvg#importOval
|
||||
* @function
|
||||
* @param {XML DOM} svgOval An SVG ellipse node
|
||||
* @return {Path.Oval} oval A Path.Oval item for Paper.js
|
||||
|
@ -161,7 +161,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
/**
|
||||
* Creates a Path.Rectangle item from an imported SVG rectangle
|
||||
*
|
||||
* @name ImportSVG#importRectangle
|
||||
* @name ImportSvg#importRectangle
|
||||
* @function
|
||||
* @param {XML DOM} svgRectangle An SVG rectangle node
|
||||
* @return {Path.Rectangle} rectangle A Path.Rectangle item for
|
||||
|
@ -171,7 +171,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* Creates a Path.RoundRectangle item from an imported SVG
|
||||
* rectangle with rounded corners
|
||||
*
|
||||
* @name ImportSVG#importRectangle
|
||||
* @name ImportSvg#importRectangle
|
||||
* @function
|
||||
* @param {XML DOM} svgRectangle An SVG rectangle node with
|
||||
* rounded corners
|
||||
|
@ -203,7 +203,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
/**
|
||||
* Creates a Path.Line item in Paper.js from an imported SVG line
|
||||
*
|
||||
* @name ImportSVG#importLine
|
||||
* @name ImportSvg#importLine
|
||||
* @function
|
||||
* @param {XML DOM} svgLine An SVG line node
|
||||
* @return {Path.Line} line A Path.Line item for Paper.js
|
||||
|
@ -224,7 +224,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
/**
|
||||
* Creates a PointText item in Paper.js from an imported SVG text node
|
||||
*
|
||||
* @name ImportSVG#importText
|
||||
* @name ImportSvg#importText
|
||||
* @function
|
||||
* @param {XML DOM} svgText An SVG text node
|
||||
* @return {Path.Text} text A PointText item for Paper.js
|
||||
|
@ -268,7 +268,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* a specific SVG node (rectangle, path, circle, polygon, etc.)
|
||||
* and creating the right Path object based on the SVG type.
|
||||
*
|
||||
* @name ImportSVG#importPath
|
||||
* @name ImportSvg#importPath
|
||||
* @function
|
||||
* @param {XML DOM} svg An SVG object
|
||||
* @return {Item} item A Paper.js item
|
||||
|
@ -374,7 +374,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* Creates a Path.Poly item in Paper.js using an imported Polygon or
|
||||
* Polyline SVG node
|
||||
*
|
||||
* @name ImportSVG#importPoly
|
||||
* @name ImportSvg#importPoly
|
||||
* @function
|
||||
* @param {XML DOM} svgPoly An SVG polygon or polyline node
|
||||
* @return {Path.Poly} poly A Path.Poly item for Paper.js
|
||||
|
@ -405,7 +405,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* attributes
|
||||
* This method is destructive to item (changes happen to it)
|
||||
*
|
||||
* @name ImportSVG#importAttributesAndStyles
|
||||
* @name ImportSvg#importAttributesAndStyles
|
||||
* @function
|
||||
* @param {XML DOM} svg An SVG node
|
||||
* @param {Item} item A Paper.js item
|
||||
|
@ -433,7 +433,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* Parses an SVG style attibute and applies it to a Paper.js item
|
||||
* This method is destructive to item (changes happen to it)
|
||||
*
|
||||
* @name ImportSVG#applyAttributeOrStyle
|
||||
* @name ImportSvg#applyAttributeOrStyle
|
||||
* @function
|
||||
* @param {Style Name} name An SVG style name
|
||||
* @param {Style Value} value The value of an SVG style
|
||||
|
@ -526,7 +526,7 @@ var ImportSVG = this.ImportSVG = Base.extend(/** @Lends ImportSVG# */{
|
|||
* made Paper.js item
|
||||
* This method is destructive to item
|
||||
*
|
||||
* @name ImportSVG#applyTransform
|
||||
* @name ImportSvg#applyTransform
|
||||
* @function
|
||||
* @param {XML DOM} An SVG node
|
||||
* @param {Item} A Paper.js item
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* This test file created by Stetson-Team-Alpha
|
||||
*/
|
||||
|
||||
module('ExportSVG');
|
||||
module('ExportSvg');
|
||||
|
||||
test('compare line path functions', function() {
|
||||
var svgns = 'http://www.w3.org/2000/svg';
|
||||
|
@ -32,7 +32,7 @@ test('compare line path functions', function() {
|
|||
|
||||
var line = new Path.Line([x1, y1], [x2, y2]);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedLine = epjs.exportPath(line);
|
||||
|
||||
var shapex1 = shape.getAttribute('x1');
|
||||
|
@ -66,7 +66,7 @@ test('compare negative line path functions', function() {
|
|||
|
||||
var line = new Path.Line([x1, y1], [x2, y2]);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedLine = epjs.exportPath(line);
|
||||
|
||||
var shapex1 = shape.getAttribute('x1');
|
||||
|
@ -100,7 +100,7 @@ test('compare invalid line path functions', function() {
|
|||
|
||||
var line = new Path.Line([x1, y1], [x2, y2]);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedLine = epjs.exportPath(line);
|
||||
|
||||
var shapex1 = shape.getAttribute('x1');
|
||||
|
@ -136,7 +136,7 @@ test('compare invalid line path functions', function() {
|
|||
var size = new Size(100, 100);
|
||||
var path = new Path.Rectangle(point, size);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(path);
|
||||
|
||||
var shapex1 = shape.getAttribute('x');
|
||||
|
@ -172,7 +172,7 @@ test('compare negative rectangle values', function() {
|
|||
var size = new Size(width, height);
|
||||
var rect = new Rectangle(topLeft, size);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(rect);
|
||||
|
||||
var shapex = shape.getAttribute('x');
|
||||
|
@ -207,7 +207,7 @@ test('compare invalid rectangle values', function() {
|
|||
var size = new Size(width, height);
|
||||
var rect = new Rectangle(topLeft, size);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(rect);
|
||||
|
||||
var shapex = shape.getAttribute('x');
|
||||
|
@ -248,7 +248,7 @@ test('compare rounded rectangle values', function() {
|
|||
var rect = new Rectangle(topLeft, size);
|
||||
var roundRect = new Path.RoundRectangle(rect, cornerSize);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(rect);
|
||||
|
||||
var shapex = shape.getAttribute('x');
|
||||
|
@ -293,7 +293,7 @@ test('compare negative rounded rectangle values', function() {
|
|||
var rect = new Rectangle(topLeft, size);
|
||||
var roundRect = new Path.RoundRectangle(rect, cornerSize);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(rect);
|
||||
|
||||
var shapex = shape.getAttribute('x');
|
||||
|
@ -338,7 +338,7 @@ test('compare invalid rounded rectangle values', function() {
|
|||
var rect = new Rectangle(topLeft, size);
|
||||
var roundRect = new Path.RoundRectangle(rect, cornerSize);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedRectangle = new epjs.exportPath(rect);
|
||||
|
||||
var shapex = shape.getAttribute('x');
|
||||
|
@ -381,7 +381,7 @@ test('compare oval values', function() {
|
|||
var rect = new Rectangle(topLeft, bottomRight);
|
||||
var oval = new Path.Oval(rect);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedOval = epjs.exportPath(oval);
|
||||
|
||||
var shapecx = shape.getAttribute('cx');
|
||||
|
@ -414,7 +414,7 @@ test('compare circle values', function() {
|
|||
var center = new Point(cx, cy);
|
||||
var circle = new Path.Circle(center, r);
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedCircle = epjs.exportPath(circle);
|
||||
|
||||
var shapecx = shape.getAttribute('cx');
|
||||
|
@ -451,7 +451,7 @@ test('compare polygon values', function() {
|
|||
poly.closePath();
|
||||
}
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedPolygon = epjs.exportPath(poly);
|
||||
|
||||
var svgPoints = shape.getAttribute('points');
|
||||
|
@ -482,7 +482,7 @@ test('compare negative polygon values', function() {
|
|||
poly.closePath();
|
||||
}
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedPolygon = epjs.exportPath(poly);
|
||||
|
||||
var svgPoints = shape.getAttribute('points');
|
||||
|
@ -513,7 +513,7 @@ test('compare polyline values', function() {
|
|||
poly.closePath();
|
||||
}
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedPolygon = epjs.exportPath(poly);
|
||||
|
||||
var svgPoints = shape.getAttribute('points');
|
||||
|
@ -544,7 +544,7 @@ test('compare negative polyline values', function() {
|
|||
poly.closePath();
|
||||
}
|
||||
|
||||
var epjs = new ExportSVG();
|
||||
var epjs = new ExportSvg();
|
||||
var exportedPolygon = epjs.exportPath(poly);
|
||||
|
||||
var svgPoints = shape.getAttribute('points');
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* This test file created by Stetson-Team-Alpha
|
||||
*/
|
||||
|
||||
module('ImportSVG');
|
||||
module('ImportSvg');
|
||||
|
||||
test('make an svg line', function() {
|
||||
var svgns = 'http://www.w3.org/2000/svg';
|
||||
|
@ -30,7 +30,7 @@ test('make an svg line', function() {
|
|||
shape.setAttribute('x2', x2);
|
||||
shape.setAttribute('y2', y2);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedLine = isvg.importSVG(shape);
|
||||
|
||||
var line = new Path.Line([x1, y1], [x2, y2]);
|
||||
|
@ -46,7 +46,7 @@ test('make an svg line with invalid values', function() {
|
|||
shape.setAttribute('x2', null);
|
||||
shape.setAttribute('y2', null);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedLine = isvg.importSVG(shape);
|
||||
|
||||
var line = new Path.Line([0, 0], [0, 0]);
|
||||
|
@ -67,7 +67,7 @@ test('compare rectangle values', function() {
|
|||
shape.setAttribute('width', width);
|
||||
shape.setAttribute('height', height);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
|
||||
var topLeft = new Point(x, y);
|
||||
|
@ -91,7 +91,7 @@ test('compare negative rectangle values', function() {
|
|||
shape.setAttribute('width', width);
|
||||
shape.setAttribute('height', height);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
var topLeft = new Point(x, y);
|
||||
var size = new Size(width, height);
|
||||
|
@ -111,7 +111,7 @@ test('compare invalid rectangle values', function() {
|
|||
shape.setAttribute('width', null);
|
||||
shape.setAttribute('height', null);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
|
||||
var topLeft = new Point(0, 0);
|
||||
|
@ -138,7 +138,7 @@ test('compare round rectangle values', function() {
|
|||
shape.setAttribute('width', width);
|
||||
shape.setAttribute('height', height);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
|
||||
var topLeft = new Point(x, y);
|
||||
|
@ -166,7 +166,7 @@ test('compare negative round rectangle values', function() {
|
|||
shape.setAttribute('width', width);
|
||||
shape.setAttribute('height', height);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
|
||||
var topLeft = new Point(x, y);
|
||||
|
@ -194,7 +194,7 @@ test('compare invalid round rectangle values', function() {
|
|||
shape.setAttribute('width', width);
|
||||
shape.setAttribute('height', height);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedRectangle = isvg.importSVG(shape);
|
||||
|
||||
var topLeft = new Point(x, y);
|
||||
|
@ -218,7 +218,7 @@ test('compare oval values', function() {
|
|||
shape.setAttribute('rx', rx);
|
||||
shape.setAttribute('ry', ry);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedOval = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(cx, cy);
|
||||
|
@ -246,7 +246,7 @@ test('compare negative oval values', function() {
|
|||
shape.setAttribute('rx', rx);
|
||||
shape.setAttribute('ry', ry);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedOval = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(cx, cy);
|
||||
|
@ -269,7 +269,7 @@ test('compare invalid oval values', function() {
|
|||
shape.setAttribute('rx', null);
|
||||
shape.setAttribute('ry', null);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedOval = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(0, 0);
|
||||
|
@ -294,7 +294,7 @@ test('compare circle values', function() {
|
|||
shape.setAttribute('cy', cy);
|
||||
shape.setAttribute('r', r);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedCircle = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(cx, cy);
|
||||
|
@ -314,7 +314,7 @@ test('compare negative circle values', function() {
|
|||
shape.setAttribute('cy', cy);
|
||||
shape.setAttribute('r', r);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedCircle = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(cx, cy);
|
||||
|
@ -332,7 +332,7 @@ test('compare invalid circle values', function() {
|
|||
shape.setAttribute('cy', null);
|
||||
shape.setAttribute('r', null);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedCircle = isvg.importSVG(shape);
|
||||
|
||||
var center = new Point(0, 0);
|
||||
|
@ -348,7 +348,7 @@ test('compare polygon values', function() {
|
|||
var svgpoints = "100,10 40,180 190,60 10,60 160,180";
|
||||
shape.setAttribute('points', svgpoints);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedPolygon = isvg.importSVG(shape);
|
||||
|
||||
var poly = new Path();
|
||||
|
@ -375,7 +375,7 @@ test('compare negative polygon values', function() {
|
|||
var svgpoints = "-100,-10 -40,-180 -190,-60 -10,-60 -160,-180";
|
||||
shape.setAttribute('points', svgpoints);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedPolygon = isvg.importSVG(shape);
|
||||
|
||||
var poly = new Path();
|
||||
|
@ -402,7 +402,7 @@ test('compare polyline values', function() {
|
|||
var svgpoints = "5,5 45,45 5,45 45,5";
|
||||
shape.setAttribute('points', svgpoints);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedPolyline = isvg.importSVG(shape);
|
||||
|
||||
var poly = new Path();
|
||||
|
@ -429,7 +429,7 @@ test('compare polyline values', function() {
|
|||
var svgpoints = "-5,-5 -45,-45 -5,-45 -45,-5";
|
||||
shape.setAttribute('points', svgpoints);
|
||||
|
||||
var isvg = new ImportSVG();
|
||||
var isvg = new ImportSvg();
|
||||
var importedPolyline = isvg.importSVG(shape);
|
||||
|
||||
var poly = new Path();
|
||||
|
|
|
@ -28,5 +28,5 @@
|
|||
|
||||
/*#*/ include('HitResult.js');
|
||||
|
||||
/*#*/ include('ImportSVG.js');
|
||||
/*#*/ include('ExportSVG.js');
|
||||
/*#*/ include('ImportSvg.js');
|
||||
/*#*/ include('ExportSvg.js');
|
||||
|
|
Loading…
Reference in a new issue