diff --git a/src/factory.ts b/src/factory.ts index 76062995b8..1d2e6ff6a7 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -195,11 +195,11 @@ export class Factory { } protected getWidth(): number { - if (!(this.options.renderer instanceof Renderer)) { - return this.options.renderer.width; + if (this.options.renderer instanceof Renderer) { + return this.options.renderer.getContext().getWidth(); } - return this.options.renderer.getContext().getWidth(); + return this.options.renderer.width; } /** Return pixels from current stave spacing. */