Skip to content

Commit

Permalink
fix first half diminuendo/crescendo lines red by default (Haydn Conce…
Browse files Browse the repository at this point in the history
…rtante m. 329) (#1218)

this wouldn't have happened if the default color for drawLine wasn't red ;)
  • Loading branch information
sschmidTU committed Sep 16, 2022
1 parent 3445343 commit c685b48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ export class GraphicalContinuousDynamicExpression extends AbstractGraphicalExpre
private addDoubleLines(upperLineStart: PointF2D, upperLineEnd: PointF2D, lowerLineStart: PointF2D, lowerLineEnd: PointF2D, wedgeLineWidth: number): void {
const upperLine: GraphicalLine = new GraphicalLine(upperLineStart, upperLineEnd, wedgeLineWidth);
const lowerLine: GraphicalLine = new GraphicalLine(lowerLineStart, lowerLineEnd, wedgeLineWidth);
if (this.rules.DefaultColorMusic) {
upperLine.colorHex = this.rules.DefaultColorMusic;
lowerLine.colorHex = this.rules.DefaultColorMusic;
}

this.lines.push(upperLine);
this.lines.push(lowerLine);
Expand Down
5 changes: 3 additions & 2 deletions src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,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.
* 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.
start = this.applyScreenTransformation(start);
stop = this.applyScreenTransformation(stop);
Expand Down Expand Up @@ -413,7 +413,8 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.Start.y);
const end: PointF2D = new PointF2D(graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.x + line.End.x,
graphicalExpression.ParentStaffLine.PositionAndShape.AbsolutePosition.y + line.End.y);
this.drawLine(start, end, line.colorHex, 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.
}
}
}
Expand Down

0 comments on commit c685b48

Please sign in to comment.