fix: 地图需要清空画布

This commit is contained in:
huanghao1412 2024-01-18 17:05:27 +08:00
parent 7c86c9abfd
commit 9894da9c89

View File

@ -199,6 +199,7 @@ const getData = () => {
Object.assign(gdMap, arr.find((_:any) => _.component === 'Picture') || {})
if(canvas.value){
const ctx = canvas.value.getContext('2d');
ctx?.clearRect(0, 0, canvas.value.width, canvas.value.height);
const img = new Image();
img.onload = function() {
if(ctx) ctx.drawImage(img, 0, 0, canvas.value.width, canvas.value.height);