From 3a490d3a668e920de62756d4895e2b7711087b59 Mon Sep 17 00:00:00 2001 From: Voellmy Raphael Date: Thu, 10 Dec 2020 17:54:57 +0100 Subject: [PATCH] fix(chord chart): fix global nut text color configuration 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 --- src/svguitar.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/svguitar.ts b/src/svguitar.ts index 1190b4d..b21ee4b 100644 --- a/src/svguitar.ts +++ b/src/svguitar.ts @@ -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) @@ -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