Rename fake 'roundRect' type to 'roundrect'.

This commit is contained in:
Jürg Lehni 2012-11-02 18:23:23 -07:00
parent c2ac16a481
commit cc503cb149

View file

@ -133,7 +133,7 @@ var SvgExporter = this.SvgExporter = /** @Lends SvgExporter */{
svg.setAttribute('width', width); svg.setAttribute('width', width);
svg.setAttribute('height', height); svg.setAttribute('height', height);
break; break;
case 'roundRect': case 'roundrect':
//d variables and point are used to determine the rounded corners for the rounded rectangle //d variables and point are used to determine the rounded corners for the rounded rectangle
var dx1 = pointArray[1].getDistance(pointArray[6]); var dx1 = pointArray[1].getDistance(pointArray[6]);
var dx2 = pointArray[0].getDistance(pointArray[7]); var dx2 = pointArray[0].getDistance(pointArray[7]);
@ -163,15 +163,15 @@ var SvgExporter = this.SvgExporter = /** @Lends SvgExporter */{
break; break;
case 'circle': case 'circle':
svg = this.create('circle'); svg = this.create('circle');
var radius = (pointArray[0].getDistance(pointArray[2], false)) /2; var radius = (pointArray[0].getDistance(pointArray[2])) /2;
svg.setAttribute('cx', path.bounds.center.x); svg.setAttribute('cx', path.bounds.center.x);
svg.setAttribute('cy', path.bounds.center.y); svg.setAttribute('cy', path.bounds.center.y);
svg.setAttribute('r', radius); svg.setAttribute('r', radius);
break; break;
case 'ellipse': case 'ellipse':
svg = this.create('ellipse'); svg = this.create('ellipse');
var radiusX = (pointArray[2].getDistance(pointArray[0], false)) / 2; var radiusX = pointArray[2].getDistance(pointArray[0]) / 2;
var radiusY = (pointArray[3].getDistance(pointArray[1], false)) /2; var radiusY = pointArray[3].getDistance(pointArray[1]) /2;
svg.setAttribute('cx', path.bounds.center.x); svg.setAttribute('cx', path.bounds.center.x);
svg.setAttribute('cy', path.bounds.center.y); svg.setAttribute('cy', path.bounds.center.y);
svg.setAttribute('rx', radiusX); svg.setAttribute('rx', radiusX);
@ -220,7 +220,7 @@ var SvgExporter = this.SvgExporter = /** @Lends SvgExporter */{
//making them paths //making them paths
var angle = this._determineIfTransformed(path, pointArray, type) + 90; var angle = this._determineIfTransformed(path, pointArray, type) + 90;
if (angle != 0) { if (angle != 0) {
if (type == 'rect' || type == 'roundRect') { if (type == 'rect' || type == 'roundrect') {
svg = this.create('path'); svg = this.create('path');
svg = this.pathSetup(path, pointArray, handleInArray, handleOutArray); svg = this.pathSetup(path, pointArray, handleInArray, handleOutArray);
} else { } else {
@ -320,7 +320,7 @@ var SvgExporter = this.SvgExporter = /** @Lends SvgExporter */{
case 'circle': case 'circle':
topMidPath = new Point(pointArray[1].getX(), pointArray[1].getY()); topMidPath = new Point(pointArray[1].getX(), pointArray[1].getY());
break; break;
case 'roundRect': case 'roundrect':
topMidPathx = (pointArray[3].getX() + pointArray[4].getX())/2; topMidPathx = (pointArray[3].getX() + pointArray[4].getX())/2;
topMidPathy = (pointArray[3].getY() + pointArray[4].getY())/2; topMidPathy = (pointArray[3].getY() + pointArray[4].getY())/2;
topMidPath = new Point(topMidPathx, topMidPathy); topMidPath = new Point(topMidPathx, topMidPathy);