|
@@ -213,7 +213,7 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
/** Draws a line in the current backend. Only usable while pages are drawn sequentially, because backend reference is updated in that process.
|
|
/** Draws a line in the current backend. Only usable while pages are drawn sequentially, because backend reference is updated in that process.
|
|
* To add your own lines after rendering, use DrawOverlayLine.
|
|
* To add your own lines after rendering, use DrawOverlayLine.
|
|
*/
|
|
*/
|
|
- protected drawLine(start: PointF2D, stop: PointF2D, color: string = "#FF0000FF", lineWidth: number = 0.2): Node {
|
|
|
|
|
|
+ protected drawLine(start: PointF2D, stop: PointF2D, color: string = "#000000FF", lineWidth: number = 0.2): Node {
|
|
// TODO maybe the backend should be given as an argument here as well, otherwise this can't be used after rendering of multiple pages is done.
|
|
// TODO maybe the backend should be given as an argument here as well, otherwise this can't be used after rendering of multiple pages is done.
|
|
start = this.applyScreenTransformation(start);
|
|
start = this.applyScreenTransformation(start);
|
|
stop = this.applyScreenTransformation(stop);
|
|
stop = this.applyScreenTransformation(stop);
|
|
@@ -347,6 +347,7 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
private drawLyrics(lyricEntries: GraphicalLyricEntry[], layer: number): void {
|
|
private drawLyrics(lyricEntries: GraphicalLyricEntry[], layer: number): void {
|
|
lyricEntries.forEach(lyricsEntry => {
|
|
lyricEntries.forEach(lyricsEntry => {
|
|
const label: GraphicalLabel = lyricsEntry.GraphicalLabel;
|
|
const label: GraphicalLabel = lyricsEntry.GraphicalLabel;
|
|
|
|
+ label.Label.colorDefault = this.rules.DefaultColorLyrics;
|
|
label.SVGNode = this.drawLabel(label, layer);
|
|
label.SVGNode = this.drawLabel(label, layer);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -369,6 +370,9 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
const vexFlowOctaveShift: VexFlowOctaveShift = graphicalOctaveShift as VexFlowOctaveShift;
|
|
const vexFlowOctaveShift: VexFlowOctaveShift = graphicalOctaveShift as VexFlowOctaveShift;
|
|
const ctx: Vex.IRenderContext = this.backend.getContext();
|
|
const ctx: Vex.IRenderContext = this.backend.getContext();
|
|
const textBracket: VF.TextBracket = vexFlowOctaveShift.getTextBracket();
|
|
const textBracket: VF.TextBracket = vexFlowOctaveShift.getTextBracket();
|
|
|
|
+ if (this.rules.DefaultColorMusic) {
|
|
|
|
+ (textBracket as any).render_options.color = this.rules.DefaultColorMusic;
|
|
|
|
+ }
|
|
textBracket.setContext(ctx);
|
|
textBracket.setContext(ctx);
|
|
try {
|
|
try {
|
|
textBracket.draw();
|
|
textBracket.draw();
|
|
@@ -385,6 +389,7 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
const vexFlowPedal: VexFlowPedal = graphicalPedal as VexFlowPedal;
|
|
const vexFlowPedal: VexFlowPedal = graphicalPedal as VexFlowPedal;
|
|
const ctx: Vex.IRenderContext = this.backend.getContext();
|
|
const ctx: Vex.IRenderContext = this.backend.getContext();
|
|
const pedalMarking: Vex.Flow.PedalMarking = vexFlowPedal.getPedalMarking();
|
|
const pedalMarking: Vex.Flow.PedalMarking = vexFlowPedal.getPedalMarking();
|
|
|
|
+ (pedalMarking as any).render_options.color = this.rules.DefaultColorMusic;
|
|
pedalMarking.setContext(ctx);
|
|
pedalMarking.setContext(ctx);
|
|
pedalMarking.draw();
|
|
pedalMarking.draw();
|
|
}
|
|
}
|
|
@@ -448,7 +453,8 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.Start.y);
|
|
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.Start.y);
|
|
const end: PointF2D = new PointF2D(graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.x + line.End.x,
|
|
const end: PointF2D = new PointF2D(graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.x + line.End.x,
|
|
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.End.y);
|
|
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.End.y);
|
|
- this.drawLine(start, end, "black", line.Width);
|
|
|
|
|
|
+ this.drawLine(start, end, line.colorHex ?? "#000000", line.Width);
|
|
|
|
+ // the null check for colorHex is not strictly necessary anymore, but the previous default color was red.
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|