Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createBoundCanvas(parentElement: HTMLElement, size: Size): CanvasCoordinateSpaceBinding {
const doc = ensureNotNull(parentElement.ownerDocument);
const canvas = createCanvas(doc);
parentElement.appendChild(canvas);
const binding = bindToDevicePixelRatio(canvas);
binding.resizeCanvas({
width: size.w,
height: size.h,
});
return binding;
}