updateWidth() {
    this.glyphs = [];
    this.width = 0;
    for (let i = 0; i < this.positions.length; ++i) {
      let fret = this.positions[i].fret;
      if (this.ghost) fret = '(' + fret + ')';
      const glyph = Flow.tabToGlyph(fret, this.render_options.scale);
      this.glyphs.push(glyph);
      this.width = Math.max(glyph.getWidth(), this.width);
    }
    // For some reason we associate a notehead glyph with a TabNote, and this
    // glyph is used for certain width calculations. Of course, this is totally
    // incorrect since a notehead is a poor approximation for the dimensions of
    // a fret number which can have multiple digits. As a result, we must
    // overwrite getWidth() to return the correct width
    this.glyph.getWidth = () => this.width;
  }
// Calculate and store the width of the note
Calculate and store the width of the note
Calculate and store the width of the note
updateWidth() {
    this.glyphs = [];
    this.width = 0;
    for (let i = 0; i < this.positions.length; ++i) {
      let fret = this.positions[i].fret;
      if (this.ghost) fret = '(' + fret + ')';
      const glyph = Flow.tabToGlyph(fret, this.render_options.scale);
      this.glyphs.push(glyph);
      this.width = Math.max(glyph.getWidth(), this.width);
    }
    this.glyph.getWidth = () => this.width;
  }
updateWidth ( ) { this . glyphs = [ ] ; this . width = 0 ; for ( let i = 0 ; i < this . positions . length ; ++ i ) { let fret = this . positions [ i ] . fret ; if ( this . ghost ) fret = '(' + fret + ')' ; const glyph = Flow . tabToGlyph ( fret , this . render_options . scale ) ; this . glyphs . push ( glyph ) ; this . width = Math . max ( glyph . getWidth ( ) , this . width ) ; } this . glyph . getWidth = ( ) => this . width ; }
Calculate and store the width of the note
Calculate and store the width of the note
// For some reason we associate a notehead glyph with a TabNote, and this // glyph is used for certain width calculations. Of course, this is totally // incorrect since a notehead is a poor approximation for the dimensions of // a fret number which can have multiple digits. As a result, we must // overwrite getWidth() to return the correct width