Skip to content

Commit

Permalink
fix(chord chart): decrease title by at least 3% when it overflows
Browse files Browse the repository at this point in the history
This prevents a maximum call stack exceeded error when the overflowing title is almost exactly es
long as the chart width"
  • Loading branch information
omnibrain committed Nov 29, 2022
1 parent 2777d14 commit 0adb8ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/svguitar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ export class SVGuitarChord {
remove()

// try again with smaller font
return this.drawTitle(size * (constants.width / width))
return this.drawTitle(size * (constants.width / width) * 0.97)
}

if (!this.settings.title && this.settings.fixedDiagramPosition) {
Expand Down

0 comments on commit 0adb8ce

Please sign in to comment.