Skip to content

Commit

Permalink
feat(SVG): Added SVGelement property to GraphicalLine, save node from…
Browse files Browse the repository at this point in the history
… drawLine in drawContinuousDynamic (opensheetmusicdisplay#1542)
  • Loading branch information
fablau authored May 13, 2024
1 parent 1f9c892 commit 8a890bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/MusicalScore/Graphical/GraphicalLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class GraphicalLine {
private end: PointF2D;
private width: number;
public colorHex: string; // will override styleId if not undefined
public SVGelement: Node;

public get Start(): PointF2D {
return this.start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ 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 ?? "#000000", line.Width);
line.SVGelement = 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 8a890bf

Please sign in to comment.