Skip to content

Commit 6f663a1

Browse files
authored
Fix <use> referencing paths with no contents (#279)
Fixes #278
1 parent 53061ff commit 6f663a1

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/nodes/geometrynode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export abstract class GeometryNode extends GraphicsNode {
8080

8181
protected getBoundingBoxCore(context: Context): Rect {
8282
const path = this.getCachedPath(context)
83-
if (!path) {
83+
if (!path || !path.segments.length) {
8484
return [0, 0, 0, 0]
8585
}
8686
let minX = Number.POSITIVE_INFINITY

test/common/tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ window.tests = [
5555
'style-sheets',
5656
'svg-viewbox',
5757
'svg-use',
58+
'svg-use-empty',
5859
'symbols',
5960
'text-fill-stroke',
6061
'text-placement',
3.36 KB
Binary file not shown.

test/specs/svg-use-empty/spec.svg

Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)