drawStemThrough() {
    const stem_x = this.getStemX();
    const stem_y = this.getStemY();
    const ctx = this.context;

    const stem_through = this.render_options.draw_stem_through_stave;
    const draw_stem = this.render_options.draw_stem;
    if (draw_stem && stem_through) {
      const total_lines = this.stave.getNumLines();
      const strings_used = this.positions.map(position => position.str);

      const unused_strings = getUnusedStringGroups(total_lines, strings_used);
      const stem_lines = getPartialStemLines(
        stem_y,
        unused_strings,
        this.getStave(),
        this.getStemDirection()
      );

      ctx.save();
      ctx.setLineWidth(Stem.WIDTH);
      stem_lines.forEach(bounds => {
        if (bounds.length === 0) return;

        ctx.beginPath();
        ctx.moveTo(stem_x, bounds[0]);
        ctx.lineTo(stem_x, bounds[bounds.length - 1]);
        ctx.stroke();
        ctx.closePath();
      });
      ctx.restore();
    }
  }
// Render the stem extension through the fret positions
Render the stem extension through the fret positions
Render the stem extension through the fret positions
drawStemThrough() {
    const stem_x = this.getStemX();
    const stem_y = this.getStemY();
    const ctx = this.context;
    const stem_through = this.render_options.draw_stem_through_stave;
    const draw_stem = this.render_options.draw_stem;
    if (draw_stem && stem_through) {
      const total_lines = this.stave.getNumLines();
      const strings_used = this.positions.map(position => position.str);
      const unused_strings = getUnusedStringGroups(total_lines, strings_used);
      const stem_lines = getPartialStemLines(
        stem_y,
        unused_strings,
        this.getStave(),
        this.getStemDirection()
      );
      ctx.save();
      ctx.setLineWidth(Stem.WIDTH);
      stem_lines.forEach(bounds => {
        if (bounds.length === 0) return;
        ctx.beginPath();
        ctx.moveTo(stem_x, bounds[0]);
        ctx.lineTo(stem_x, bounds[bounds.length - 1]);
        ctx.stroke();
        ctx.closePath();
      });
      ctx.restore();
    }
  }
drawStemThrough ( ) { const stem_x = this . getStemX ( ) ; const stem_y = this . getStemY ( ) ; const ctx = this . context ; const stem_through = this . render_options . draw_stem_through_stave ; const draw_stem = this . render_options . draw_stem ; if ( draw_stem && stem_through ) { const total_lines = this . stave . getNumLines ( ) ; const strings_used = this . positions . map ( position => position . str ) ; const unused_strings = getUnusedStringGroups ( total_lines , strings_used ) ; const stem_lines = getPartialStemLines ( stem_y , unused_strings , this . getStave ( ) , this . getStemDirection ( ) ) ; ctx . save ( ) ; ctx . setLineWidth ( Stem . WIDTH ) ; stem_lines . forEach ( bounds => { if ( bounds . length === 0 ) return ; ctx . beginPath ( ) ; ctx . moveTo ( stem_x , bounds [ 0 ] ) ; ctx . lineTo ( stem_x , bounds [ bounds . length - 1 ] ) ; ctx . stroke ( ) ; ctx . closePath ( ) ; } ) ; ctx . restore ( ) ; } }
Render the stem extension through the fret positions
Render the stem extension through the fret positions