Skip to content

Commit

Permalink
fix(chord chart): fix global nut text color configuration
Browse files Browse the repository at this point in the history
Make sure the global nut text color is applied for all fingers. Before this fix the global nut text
color was only applied on barre chords.

fix #47
  • Loading branch information
Voellmy Raphael authored and Voellmy Raphael committed Dec 10, 2020
1 parent 11f7073 commit 3a490d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/svguitar.ts
Expand Up @@ -678,11 +678,6 @@ export class SVGuitarChord {
],
)
.forEach(([stringIndex, fretIndex, textOrOptions]) => {
// const nutCenterX = x + stringIndex * stringSpacing
// const startX = size / 2;
// const nutCenterY = y + fretIndex * fretSpacing - fretSpacing / 2;
// const startY = nutCenterY - size / 2
//
const nutCenterX = startX + stringIndex * stringSpacing
const nutCenterY = y + fretIndex * fretSpacing - fretSpacing / 2
const fingerOptions = SVGuitarChord.getFingerOptions(textOrOptions)
Expand Down Expand Up @@ -743,7 +738,8 @@ export class SVGuitarChord {
fingerOptions: FingerOptions,
) {
const shape = fingerOptions.shape ?? defaultSettings.shape
const nutTextColor = fingerOptions.textColor ?? defaultSettings.nutTextColor
const nutTextColor =
fingerOptions.textColor ?? this.settings.nutTextColor ?? defaultSettings.nutTextColor
const startX = x - size / 2
const startY = y - size / 2

Expand Down

0 comments on commit 3a490d3

Please sign in to comment.