@@ -23,23 +23,24 @@ export class ChordDiagramGlyph extends EffectGlyph {
2323
2424 public doLayout ( ) : void {
2525 super . doLayout ( ) ;
26+ const scale = this . scale ;
2627 let res : RenderingResources = this . renderer . resources ;
27- this . _textRow = res . effectFont . size * 1.5 ;
28- this . _fretRow = res . effectFont . size * 1.5 ;
28+ this . _textRow = res . effectFont . size * 1.5 * scale ;
29+ this . _fretRow = res . effectFont . size * 1.5 * scale ;
2930 if ( this . _chord . firstFret > 1 ) {
30- this . _firstFretSpacing = ChordDiagramGlyph . FretSpacing * this . scale ;
31+ this . _firstFretSpacing = ChordDiagramGlyph . FretSpacing * scale ;
3132 } else {
3233 this . _firstFretSpacing = 0 ;
3334 }
3435 this . height =
3536 this . _textRow +
3637 this . _fretRow +
37- ( ChordDiagramGlyph . Frets - 1 ) * ChordDiagramGlyph . FretSpacing * this . scale +
38- 2 * ChordDiagramGlyph . Padding ;
38+ ( ChordDiagramGlyph . Frets - 1 ) * ChordDiagramGlyph . FretSpacing * scale +
39+ 2 * ChordDiagramGlyph . Padding * scale ;
3940 this . width =
4041 this . _firstFretSpacing +
41- ( this . _chord . staff . tuning . length - 1 ) * ChordDiagramGlyph . StringSpacing * this . scale +
42- 2 * ChordDiagramGlyph . Padding ;
42+ ( this . _chord . staff . tuning . length - 1 ) * ChordDiagramGlyph . StringSpacing * scale +
43+ 2 * ChordDiagramGlyph . Padding * scale ;
4344 }
4445
4546 public paint ( cx : number , cy : number , canvas : ICanvas ) : void {
@@ -114,14 +115,14 @@ export class ChordDiagramGlyph extends EffectGlyph {
114115 info [ 1 ] = guitarString ;
115116 }
116117 }
117- let y : number = cy + fret * fretSpacing + fretSpacing / 2 + 0.5 ;
118+ let y : number = cy + fret * fretSpacing + fretSpacing / 2 + 0.5 * this . scale ;
118119 let x : number = cx + ( this . _chord . strings . length - guitarString - 1 ) * stringSpacing ;
119120 canvas . fillCircle ( x , y , circleRadius ) ;
120121 }
121122 }
122123
123124 for ( const [ fret , strings ] of barreLookup ) {
124- let y : number = cy + fret * fretSpacing + fretSpacing / 2 + this . scale ;
125+ let y : number = cy + fret * fretSpacing + fretSpacing / 2 + 0.5 * this . scale ;
125126 let xLeft : number = cx + ( this . _chord . strings . length - strings [ 1 ] - 1 ) * stringSpacing ;
126127 let xRight : number = cx + ( this . _chord . strings . length - strings [ 0 ] - 1 ) * stringSpacing ;
127128 canvas . fillRect ( xLeft , y - circleRadius , xRight - xLeft , circleRadius * 2 ) ;
0 commit comments