|
@@ -373,22 +373,24 @@ THREE.SVGLoader.prototype = {
|
|
|
case 'Z':
|
|
|
case 'z':
|
|
|
path.currentPath.autoClose = true;
|
|
|
- // Reset point to beginning of Path
|
|
|
- var curve = path.currentPath.curves[ 0 ];
|
|
|
- if ( curve.isLineCurve ) {
|
|
|
- point.x = curve.v1.x;
|
|
|
- point.y = curve.v1.y;
|
|
|
- } else if ( curve.isEllipseCurve || curve.isArcCurve ) {
|
|
|
- point.x = curve.aX;
|
|
|
- point.y = curve.aY;
|
|
|
- } else if ( curve.isCubicBezierCurve || curve.isQuadraticBezierCurve ) {
|
|
|
- point.x = curve.v0.x;
|
|
|
- point.y = curve.v0.y;
|
|
|
- } else if ( curve.isSplineCurve ) {
|
|
|
- point.x = curve.points[ 0 ].x;
|
|
|
- point.y = curve.points[ 0 ].y;
|
|
|
+ if ( path.currentPath.curves.length > 0 ) {
|
|
|
+ // Reset point to beginning of Path
|
|
|
+ var curve = path.currentPath.curves[ 0 ];
|
|
|
+ if ( curve.isLineCurve ) {
|
|
|
+ point.x = curve.v1.x;
|
|
|
+ point.y = curve.v1.y;
|
|
|
+ } else if ( curve.isEllipseCurve || curve.isArcCurve ) {
|
|
|
+ point.x = curve.aX;
|
|
|
+ point.y = curve.aY;
|
|
|
+ } else if ( curve.isCubicBezierCurve || curve.isQuadraticBezierCurve ) {
|
|
|
+ point.x = curve.v0.x;
|
|
|
+ point.y = curve.v0.y;
|
|
|
+ } else if ( curve.isSplineCurve ) {
|
|
|
+ point.x = curve.points[ 0 ].x;
|
|
|
+ point.y = curve.points[ 0 ].y;
|
|
|
+ }
|
|
|
+ path.currentPath.currentPoint.copy( point );
|
|
|
}
|
|
|
- path.currentPath.currentPoint.copy( point );
|
|
|
break;
|
|
|
|
|
|
default:
|