Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/rendering/EffectBand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ export class EffectBand extends Glyph {
// load the effect from the previous renderer if possible.
let previousRenderer: EffectBarRenderer = this.renderer
.previousRenderer as EffectBarRenderer;
let previousBand: EffectBand = previousRenderer.getBand(this.voice, this.info.effectId)!;
let voiceGlyphs: Map<number, EffectGlyph> = previousBand._effectGlyphs[b.voice.index];
if (voiceGlyphs.has(prevBeat.index)) {
prevEffect = voiceGlyphs.get(prevBeat.index)!;
let previousBand = previousRenderer.getBand(prevBeat.voice, this.info.effectId);
// it can happen that we have an empty voice and then we don't have an effect band
if(previousBand) {
let voiceGlyphs: Map<number, EffectGlyph> = previousBand._effectGlyphs[prevBeat.voice.index];
if (voiceGlyphs.has(prevBeat.index)) {
prevEffect = voiceGlyphs.get(prevBeat.index)!;
}
}
}
// if the effect cannot be expanded, create a new glyph
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions test/visualTests/issues/BrokenRenders.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { VisualTestHelper } from "../VisualTestHelper";

describe('BrokenRendersTests', () => {
it('let-ring-empty-voice', async () =>{
await VisualTestHelper.runVisualTest('issues/let-ring-empty-voice.gp');
})
})