libreoffice-online/browser/mocha_tests/helper/canvasContainerSetup.ts
Dennis Francis c744ed64dc mocha: move container setup code
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I5f31276c3570d2ab02a2820848cb2393dfb0b760
2023-01-18 16:45:02 +05:30

23 lines
673 B
TypeScript

/// <reference path="../../src/layer/tile/CanvasSectionContainer.ts" />
function canvasDomString() {
return `
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id="canvas-container">
<canvas id="document-canvas"></canvas>
</div>
</body>
</html>`;
}
function setupCanvasContainer(width: number, height: number): CanvasSectionContainer {
const canvas = <HTMLCanvasElement>document.getElementById('document-canvas');
const sectionContainer = new CanvasSectionContainer(canvas, true /* disableDrawing? */);
sectionContainer.onResize(width, height); // Set canvas size.
return sectionContainer;
}