提交 64346d56 编写于 作者: M Mr.doob

SVGLoader: Fixed Zz case crash.

上级 1476110d
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册