lastX, lastY] = getPosition(e);
	}

	// 结束绘制
	function stopDrawing() {
		isDrawing = false;
	}

	// 获取鼠标或触摸位置
	function getPosition(e) {
		if (e.type.includes('touch')) {
			var touch = e.touches[0] || e.changedTouches[0];
			return [touch.clientX - canvas.offsetLeft, touch.clientY - canvas.offsetTop];
		} else {
			return [e.clientX - canvas.offsetLeft, e.clientY - canvas.offsetTop];
		}
	}

	// 添加鼠标事件监听器
	canvas.addEventListener("mousedown", startDrawing);
	canv