Skip to content

Commit a39e849

Browse files
authored
SVGLoader: Make createShapes() retain curves (#22778)
1 parent 964ea37 commit a39e849

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/jsm/loaders/SVGLoader.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ class SVGLoader extends Loader {
20842084

20852085
}
20862086

2087-
return { points: points, isCW: ShapeUtils.isClockWise( points ), identifier: identifier ++, boundingBox: new Box2( new Vector2( minX, minY ), new Vector2( maxX, maxY ) ) };
2087+
return { curves: p.curves, points: points, isCW: ShapeUtils.isClockWise( points ), identifier: identifier ++, boundingBox: new Box2( new Vector2( minX, minY ), new Vector2( maxX, maxY ) ) };
20882088

20892089
} );
20902090

@@ -2101,12 +2101,15 @@ class SVGLoader extends Loader {
21012101

21022102
if ( ! amIAHole.isHole ) {
21032103

2104-
const shape = new Shape( p.points );
2104+
const shape = new Shape();
2105+
shape.curves = p.curves;
21052106
const holes = isAHole.filter( h => h.isHole && h.for === p.identifier );
21062107
holes.forEach( h => {
21072108

2108-
const path = simplePaths[ h.identifier ];
2109-
shape.holes.push( new Path( path.points ) );
2109+
const hole = simplePaths[ h.identifier ];
2110+
const path = new Path();
2111+
path.curves = hole.curves;
2112+
shape.holes.push( path );
21102113

21112114
} );
21122115
shapesToReturn.push( shape );

0 commit comments

Comments
 (0)