Skip to main content

scaleBuffer

Home > @anocca/sequence-viewer-utils > scaleBuffer

Scale the canvas according to the device pixel ratio

Signature:

export declare function scaleBuffer(canvas: HTMLCanvasElement, width: number, height: number): {
ratio: number;
shouldScale: boolean;
} | undefined;

Parameters

ParameterTypeDescription
canvasHTMLCanvasElement
widthnumber
heightnumber

Returns:

{ ratio: number; shouldScale: boolean; } | undefined