Skip to content

Commit 0a6db77

Browse files
committed
Avoid collision logic if no multivoice
1 parent 5e2f9ba commit 0a6db77

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/rendering/ScoreBarRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export class ScoreBarRenderer extends BarRendererBase {
353353

354354
public applyLayoutingInfo(): boolean {
355355
const result = super.applyLayoutingInfo();
356-
if(result) {
356+
if(result && this.bar.isMultiVoice) {
357357
// consider rest overflows
358358
let top: number = this.getScoreY(-2, 0);
359359
let bottom: number = this.getScoreY(6, 0);

src/rendering/glyphs/ScoreBeatGlyph.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,18 @@ export class ScoreBeatGlyph extends BeatOnNoteGlyphBase {
150150
this.restGlyph.beamingHelper = this.beamingHelper;
151151
this.addGlyph(this.restGlyph);
152152

153-
if (this.container.beat.voice.index === 0) {
154-
const restSizes = BeamingHelper.computeLineHeightsForRest(this.container.beat.duration);
155-
let restTop = this.restGlyph.y - sr.getScoreHeight(restSizes[0]);
156-
let restBottom = this.restGlyph.y + sr.getScoreHeight(restSizes[1]);
157-
this.renderer.layoutingInfo.setBeatYPositions(this.container.beat, restTop, restBottom);
158-
} else {
159-
this.renderer.layoutingInfo.registerRest(this.container.beat);
153+
if (this.renderer.bar.isMultiVoice) {
154+
if (this.container.beat.voice.index === 0) {
155+
const restSizes = BeamingHelper.computeLineHeightsForRest(this.container.beat.duration);
156+
let restTop = this.restGlyph.y - sr.getScoreHeight(restSizes[0]);
157+
let restBottom = this.restGlyph.y + sr.getScoreHeight(restSizes[1]);
158+
this.renderer.layoutingInfo.setBeatYPositions(this.container.beat, restTop, restBottom);
159+
} else {
160+
this.renderer.layoutingInfo.registerRest(this.container.beat);
161+
}
160162
}
161163

164+
162165
if (this.beamingHelper) {
163166
this.beamingHelper.applyRest(this.container.beat, line);
164167
}

0 commit comments

Comments
 (0)