保持canvas的大小与容器一致

保持 canvas 容器与框架大小一致

1
2
3
4
5
6
7
8
9
10
11

resizeFunc() {
var can = document.getElementById('project-progress-canvas');
var canvasContainer = document.getElementById("project-progress-canvas-container");
if (can) {
can.height = canvasContainer.offsetHeight;
can.width = canvasContainer.offsetWidth;
this.draw();
}
}