|
@@ -1038,11 +1038,15 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
endStaffEntry = endMeasure.staffEntries[endMeasure.staffEntries.length - 1];
|
|
|
// TODO can be undefined if no notes in end measure
|
|
|
}
|
|
|
- graphicalPedal.setStartNote(startStaffEntry);
|
|
|
+ if(!graphicalPedal.setStartNote(startStaffEntry)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
if (endStaffLine !== startStaffLine) {
|
|
|
if(graphicalPedal.pedalSymbol === MusicSymbol.PEDAL_SYMBOL){
|
|
|
- graphicalPedal.setEndNote(endStaffEntry);
|
|
|
+ if(!graphicalPedal.setEndNote(endStaffEntry)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
graphicalPedal.setEndMeasure(endMeasure);
|
|
|
graphicalPedal.ReleaseText = " ";
|
|
|
graphicalPedal.CalculateBoundingBox();
|
|
@@ -1052,8 +1056,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
// pedal starts on the first measure
|
|
|
const nextPedal: VexFlowPedal = new VexFlowPedal(pedal, nextPedalFirstMeasure.PositionAndShape);
|
|
|
const firstNote: GraphicalStaffEntry = nextPedalFirstMeasure.staffEntries[0];
|
|
|
- nextPedal.setStartNote(firstNote);
|
|
|
- nextPedal.setEndNote(endStaffEntry);
|
|
|
+ if(!nextPedal.setStartNote(firstNote) || !nextPedal.setEndNote(endStaffEntry)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
graphicalPedal.setEndMeasure(endMeasure);
|
|
|
endStaffLine.Pedals.push(nextPedal);
|
|
|
nextPedal.CalculateBoundingBox();
|
|
@@ -1065,7 +1070,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
lastMeasureOfFirstShift = endMeasure;
|
|
|
}
|
|
|
const lastNoteOfFirstShift: GraphicalStaffEntry = lastMeasureOfFirstShift.staffEntries[lastMeasureOfFirstShift.staffEntries.length - 1];
|
|
|
- graphicalPedal.setEndNote(lastNoteOfFirstShift);
|
|
|
+ if(!graphicalPedal.setEndNote(lastNoteOfFirstShift)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
graphicalPedal.setEndMeasure(endMeasure);
|
|
|
|
|
|
const systemsInBetweenCount: number = endStaffLine.ParentMusicSystem.Id - startStaffLine.ParentMusicSystem.Id;
|
|
@@ -1093,9 +1100,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
nextPedalLastMeasure = endMeasure;
|
|
|
lastNote = endStaffEntry;
|
|
|
}
|
|
|
-
|
|
|
- nextPedal.setStartNote(firstNote);
|
|
|
- nextPedal.setEndNote(lastNote);
|
|
|
+ if(!nextPedal.setStartNote(firstNote) || !nextPedal.setEndNote(lastNote)){
|
|
|
+ break;
|
|
|
+ }
|
|
|
graphicalPedal.setEndMeasure(endMeasure);
|
|
|
nextPedalStaffline.Pedals.push(nextPedal);
|
|
|
nextPedal.CalculateBoundingBox();
|
|
@@ -1106,7 +1113,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
this.calculatePedalSkyBottomLine(graphicalPedal.startVfVoiceEntry, graphicalPedal.endVfVoiceEntry, graphicalPedal, startStaffLine);
|
|
|
}
|
|
|
} else {
|
|
|
- graphicalPedal.setEndNote(endStaffEntry);
|
|
|
+ if(!graphicalPedal.setEndNote(endStaffEntry)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
graphicalPedal.setEndMeasure(endMeasure);
|
|
|
graphicalPedal.CalculateBoundingBox();
|
|
|
this.calculatePedalSkyBottomLine(graphicalPedal.startVfVoiceEntry, graphicalPedal.endVfVoiceEntry, graphicalPedal, startStaffLine);
|