Skip to content

Commit

Permalink
Fix <use> referencing paths with no contents (#279)
Browse files Browse the repository at this point in the history
Fixes #278
  • Loading branch information
edemaine committed Dec 11, 2023
1 parent 53061ff commit 6f663a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nodes/geometrynode.ts
Expand Up @@ -80,7 +80,7 @@ export abstract class GeometryNode extends GraphicsNode {

protected getBoundingBoxCore(context: Context): Rect {
const path = this.getCachedPath(context)
if (!path) {
if (!path || !path.segments.length) {
return [0, 0, 0, 0]
}
let minX = Number.POSITIVE_INFINITY
Expand Down
1 change: 1 addition & 0 deletions test/common/tests.js
Expand Up @@ -55,6 +55,7 @@ window.tests = [
'style-sheets',
'svg-viewbox',
'svg-use',
'svg-use-empty',
'symbols',
'text-fill-stroke',
'text-placement',
Expand Down
Binary file added test/specs/svg-use-empty/reference.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions test/specs/svg-use-empty/spec.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f663a1

Please sign in to comment.