[fix] Remove group shape export backgrounds (#1587)

This PR removes the default SVG export for groups.

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. Create a group
2. Export it to SVG

### Release Notes

- Fix image exports for groups
This commit is contained in:
Steve Ruiz 2023-06-14 23:04:42 +01:00 committed by GitHub
parent 3e2f2e0884
commit 36e8813bf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6088,6 +6088,9 @@ export class Editor extends EventEmitter<TLEventMap> {
if (id === singleFrameShapeId) return [] if (id === singleFrameShapeId) return []
const shape = this.getShapeById(id)! const shape = this.getShapeById(id)!
if (this.isShapeOfType(shape, GroupShapeUtil)) return []
const util = this.getShapeUtil(shape) const util = this.getShapeUtil(shape)
let font: string | undefined let font: string | undefined
@ -6113,6 +6116,7 @@ export class Editor extends EventEmitter<TLEventMap> {
outerElement.appendChild(shapeSvgElement) outerElement.appendChild(shapeSvgElement)
shapeSvgElement = outerElement shapeSvgElement = outerElement
} }
if (backgroundSvgElement) { if (backgroundSvgElement) {
const outerElement = document.createElementNS('http://www.w3.org/2000/svg', 'g') const outerElement = document.createElementNS('http://www.w3.org/2000/svg', 'g')
outerElement.appendChild(backgroundSvgElement) outerElement.appendChild(backgroundSvgElement)