Remove duplicate code (#4128)

Looks like some leftovers since we are conditionally doing the same
thing on the next line. I might be missing something though.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Release notes

- Remove some duplicate code which should make some of the exports a bit
smaller.
This commit is contained in:
Mitja Bezenšek 2024-07-10 10:58:47 +02:00 committed by GitHub
parent 60f43e947e
commit 89d7438ca3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 2 deletions

View file

@ -237,7 +237,6 @@ export class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
} }
override toSvg(shape: TLNoteShape, ctx: SvgExportContext) { override toSvg(shape: TLNoteShape, ctx: SvgExportContext) {
ctx.addExportDef(getFontDefForExport(shape.props.font))
if (shape.props.text) ctx.addExportDef(getFontDefForExport(shape.props.font)) if (shape.props.text) ctx.addExportDef(getFontDefForExport(shape.props.font))
const theme = getDefaultColorTheme({ isDarkMode: ctx.isDarkMode }) const theme = getDefaultColorTheme({ isDarkMode: ctx.isDarkMode })
const bounds = getBoundsForSVG(shape) const bounds = getBoundsForSVG(shape)

View file

@ -112,7 +112,6 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
} }
override toSvg(shape: TLTextShape, ctx: SvgExportContext) { override toSvg(shape: TLTextShape, ctx: SvgExportContext) {
ctx.addExportDef(getFontDefForExport(shape.props.font))
if (shape.props.text) ctx.addExportDef(getFontDefForExport(shape.props.font)) if (shape.props.text) ctx.addExportDef(getFontDefForExport(shape.props.font))
const bounds = this.editor.getShapeGeometry(shape).bounds const bounds = this.editor.getShapeGeometry(shape).bounds