fix: 🐛 eslint 告警问题修复

Former-commit-id: 7ffbab34f126c63d4561b02218431243b7483924
This commit is contained in:
郝先瑞
2023-11-08 22:22:38 +08:00
parent 53e58fbc3c
commit 642f4cbe8c
11 changed files with 27 additions and 1117 deletions

View File

@@ -132,35 +132,6 @@ function paint(
ctx.closePath();
ctx.stroke();
}
// 橡皮
function eraser(
startX: number,
startY: number,
endX: number,
endY: number,
ctx: CanvasRenderingContext2D,
size: number,
shape: "rect" | "circle"
) {
ctx.beginPath();
ctx.globalAlpha = 1;
switch (shape) {
case "rect":
ctx.lineWidth = size;
ctx.strokeStyle = "#fff";
ctx.moveTo(startX, startY);
ctx.lineTo(endX, endY);
ctx.closePath();
ctx.stroke();
break;
case "circle":
ctx.fillStyle = "#fff";
ctx.arc(startX, startY, size, 0, 2 * Math.PI);
ctx.fill();
break;
}
}
</script>
<template>
<div class="canvas-dom">