|
@@ -1009,6 +1009,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
endMeasure = this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(pedal.ParentEndMultiExpression.SourceMeasureParent,
|
|
|
staffIndex);
|
|
|
} else {
|
|
|
+ //return; // also possible: don't handle faulty pedal without end
|
|
|
endMeasure = this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(staffIndex, true); // get last rendered measure
|
|
|
}
|
|
|
if (endMeasure.MeasureNumber > maxMeasureToDrawIndex + 1) { // ends in measure not rendered
|
|
@@ -1017,9 +1018,15 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
let startMeasure: GraphicalMeasure = undefined;
|
|
|
if (pedal.ParentEndMultiExpression) {
|
|
|
startMeasure = this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(pedal.ParentStartMultiExpression.SourceMeasureParent,
|
|
|
- staffIndex);
|
|
|
+ staffIndex);
|
|
|
} else {
|
|
|
- startMeasure = this.graphicalMusicSheet.MeasureList[minMeasureToDrawIndex][staffIndex]; // first rendered measure
|
|
|
+ startMeasure = this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(
|
|
|
+ pedal.ParentStartMultiExpression.SourceMeasureParent,
|
|
|
+ staffIndex);
|
|
|
+ if (!startMeasure) {
|
|
|
+ startMeasure = this.graphicalMusicSheet.MeasureList[minMeasureToDrawIndex][staffIndex]; // first rendered measure
|
|
|
+ }
|
|
|
+ //console.log("no end multi expression for start measure " + startMeasure.MeasureNumber);
|
|
|
}
|
|
|
if (startMeasure.MeasureNumber < minMeasureToDrawIndex + 1) { // starts before range of measures selected to render
|
|
|
startMeasure = this.graphicalMusicSheet.MeasureList[minMeasureToDrawIndex][staffIndex]; // first rendered measure
|
|
@@ -1426,7 +1433,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
//Only do these changes if current footroom is higher
|
|
|
if(footroom > yLineForOtherPedalMarking) {
|
|
|
const otherPedalMarkingMarginXOffset: number = otherPedalMarking.render_options.text_margin_right / 10;
|
|
|
- const otherPedalStartX: number = vfOtherPedal.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x - otherPedalMarkingMarginXOffset;
|
|
|
+ let otherPedalStartX: number = vfOtherPedal.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x - otherPedalMarkingMarginXOffset;
|
|
|
let otherPedalStopX: number = undefined;
|
|
|
vfOtherPedal.setLine(footroom - 3 - (parentStaffline.StaffLines.length - 1));
|
|
|
let otherPedalEndBBox: BoundingBox = vfOtherPedal.endVfVoiceEntry?.PositionAndShape;
|
|
@@ -1465,6 +1472,13 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
|
|
|
const otherClefWidth: number = vfOtherClefBefore.getWidth() / 10;
|
|
|
otherPedalStopX += otherClefWidth;
|
|
|
}
|
|
|
+ if (otherPedalStartX > otherPedalStopX) {
|
|
|
+ // TODO this shouldn't happen, though this fixes the SkyBottomLineCalculator error for now (startIndex needs to be <= endIndex)
|
|
|
+ // switch startX and stopX
|
|
|
+ const otherStartX: number = otherPedalStartX;
|
|
|
+ otherPedalStartX = otherPedalStopX;
|
|
|
+ otherPedalStopX = otherStartX;
|
|
|
+ }
|
|
|
parentStaffline.SkyBottomLineCalculator.updateBottomLineInRange(otherPedalStartX, otherPedalStopX, footroom + otherPedalBracketHeight);
|
|
|
}
|
|
|
}
|