Skip to content

Commit

Permalink
Move constant out to font metrics files.
Browse files Browse the repository at this point in the history
This adjustment tells the stem to render shorter when there is
a flag to be drawn.
See: musicFont.lookupMetric('stem.renderHeightAdjustmentForFlag')
  • Loading branch information
ronyeh committed Apr 30, 2021
1 parent ee207c3 commit abf1f82
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 196 deletions.
2 changes: 1 addition & 1 deletion src/beam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ export class Beam extends Element {
const beamExtension = stem_direction === Stem.UP ? stemTipY - beamedStemTipY : beamedStemTipY - stemTipY;

stem.setExtension(preBeamExtension + beamExtension);
stem.renderHeightAdjustment = -Stem.WIDTH / 2;
stem.adjustHeightForBeam();

if (note.isRest() && show_stemlets) {
const beamWidth = beam_width;
Expand Down
Loading

0 comments on commit abf1f82

Please sign in to comment.