Skip to content

Commit

Permalink
Fix: Add default DPR for older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
tonilastre authored Feb 20, 2024
1 parent 1dfb6f5 commit 642f882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/canvas/canvas-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class CanvasRenderer<N extends INodeBase, E extends IEdgeBase> extends Em
}

private _resize() {
const dpr = this._settings.devicePixelRatio || window.devicePixelRatio;
const dpr = this._settings.devicePixelRatio || window.devicePixelRatio || 1;

const containerSize = this._container.getBoundingClientRect();
this._canvas.style.width = `${containerSize.width}px`;
Expand Down

0 comments on commit 642f882

Please sign in to comment.