|
@@ -13,17 +13,15 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
private renderer: Vex.Flow.Renderer;
|
|
private renderer: Vex.Flow.Renderer;
|
|
private vfctx: Vex.Flow.CanvasContext;
|
|
private vfctx: Vex.Flow.CanvasContext;
|
|
private ctx: CanvasRenderingContext2D;
|
|
private ctx: CanvasRenderingContext2D;
|
|
- private titles: HTMLElement;
|
|
|
|
private zoom: number = 1.0;
|
|
private zoom: number = 1.0;
|
|
|
|
|
|
- constructor(titles: HTMLElement, canvas: HTMLCanvasElement, isPreviewImageDrawer: boolean = false) {
|
|
|
|
|
|
+ constructor(canvas: HTMLCanvasElement, isPreviewImageDrawer: boolean = false) {
|
|
super(new VexFlowTextMeasurer(), isPreviewImageDrawer);
|
|
super(new VexFlowTextMeasurer(), isPreviewImageDrawer);
|
|
this.renderer = new Vex.Flow.Renderer(canvas, Vex.Flow.Renderer.Backends.CANVAS);
|
|
this.renderer = new Vex.Flow.Renderer(canvas, Vex.Flow.Renderer.Backends.CANVAS);
|
|
this.vfctx = this.renderer.getContext();
|
|
this.vfctx = this.renderer.getContext();
|
|
// The following is a hack to retrieve the actual canvas' drawing context
|
|
// The following is a hack to retrieve the actual canvas' drawing context
|
|
// Not supposed to work forever....
|
|
// Not supposed to work forever....
|
|
this.ctx = (this.vfctx as any).vexFlowCanvasContext;
|
|
this.ctx = (this.vfctx as any).vexFlowCanvasContext;
|
|
- this.titles = titles;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -77,20 +75,6 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
|
|
*/
|
|
*/
|
|
protected renderLabel(graphicalLabel: GraphicalLabel, layer: number, bitmapWidth: number,
|
|
protected renderLabel(graphicalLabel: GraphicalLabel, layer: number, bitmapWidth: number,
|
|
bitmapHeight: number, heightInPixel: number, screenPosition: PointF2D): void {
|
|
bitmapHeight: number, heightInPixel: number, screenPosition: PointF2D): void {
|
|
- // if (screenPosition.y < 0) {
|
|
|
|
- // // Temportary solution for title labels
|
|
|
|
- // let div: HTMLElement = document.createElement("div");
|
|
|
|
- // div.style.fontSize = (graphicalLabel.Label.fontHeight * this.zoom * 10.0) + "px";
|
|
|
|
- // //span.style.width = (bitmapWidth * this.zoom * 1.1) + "px";
|
|
|
|
- // //span.style.height = (bitmapHeight * this.zoom * 1.1) + "px";
|
|
|
|
- // //span.style.overflow = "hidden";
|
|
|
|
- // div.style.fontFamily = "Times New Roman";
|
|
|
|
- // //span.style.marginLeft = (screenPosition.x * this.zoom) + "px";
|
|
|
|
- // div.style.textAlign = "center";
|
|
|
|
- // div.appendChild(document.createTextNode(graphicalLabel.Label.text));
|
|
|
|
- // this.titles.appendChild(div);
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
let ctx: CanvasRenderingContext2D = (this.vfctx as any).vexFlowCanvasContext;
|
|
let ctx: CanvasRenderingContext2D = (this.vfctx as any).vexFlowCanvasContext;
|
|
let old: string = ctx.font;
|
|
let old: string = ctx.font;
|
|
ctx.font = VexFlowConverter.font(
|
|
ctx.font = VexFlowConverter.font(
|