Skip to content

Commit 2a1fc6d

Browse files
authored
Merge pull request #13771 from mrdoob/svgloader
SVGLoader: Fixed circle and ellipse parsing.
2 parents 87e8d26 + e12c120 commit 2a1fc6d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/js/loaders/SVGLoader.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,11 @@ THREE.SVGLoader.prototype = {
403403
var y = parseFloat( node.getAttribute( 'cy' ) );
404404
var r = parseFloat( node.getAttribute( 'r' ) );
405405

406-
var path = new THREE.ShapePath();
406+
var subpath = new THREE.Path();
407+
subpath.absarc( x, y, r, 0, Math.PI * 2 );
407408

408-
path.currentPath.absarc( x, y, r, 0, Math.PI * 2 );
409+
var path = new THREE.ShapePath();
410+
path.subPaths.push( subpath );
409411

410412
return path;
411413

@@ -418,9 +420,11 @@ THREE.SVGLoader.prototype = {
418420
var rx = parseFloat( node.getAttribute( 'rx' ) );
419421
var ry = parseFloat( node.getAttribute( 'ry' ) );
420422

421-
var path = new THREE.ShapePath();
423+
var subpath = new THREE.Path();
424+
subpath.absellipse( x, y, rx, ry, 0, Math.PI * 2 );
422425

423-
path.currentPath.absellipse( x, y, rx, ry, 0, Math.PI * 2 );
426+
var path = new THREE.ShapePath();
427+
path.subPaths.push( subpath );
424428

425429
return path;
426430

0 commit comments

Comments
 (0)