feat: 绘制Header和Legend

This commit is contained in:
zhangyi
2025-03-21 17:23:53 +08:00
parent 4fc975bc03
commit b7a581fd16
5 changed files with 177 additions and 5 deletions
+17
View File
@@ -0,0 +1,17 @@
import { PAPER_SIZE } from './constant';
export function setCanvasSize(canvas: Canvas, paperSize: PaperSize) {
const sizeObj = PAPER_SIZE[paperSize];
// const { pixelRatio: dpr, windowWidth, windowHeight } = wx.getWindowInfo();
// const printWidth = A4.width;
// const printHeight = A4.height;
// @ts-ignore
// const originWidth = canvas._width || windowWidth;
// // @ts-ignore
// const originHeight = canvas._height || windowHeight;
canvas.width = sizeObj.width;
canvas.height = sizeObj.height;
console.log('canvas----:', canvas);
return canvas;
}