|
@@ -143,11 +143,12 @@
|
|
|
*/
|
|
|
|
|
|
const canvas = document.getElementById('box');
|
|
|
+ canvas.width = screenW;
|
|
|
+ canvas.height = screenH;
|
|
|
context = canvas.getContext('2d');
|
|
|
|
|
|
const drawTriangle = (a, b, c) => {
|
|
|
- // console.log(context, Math.round(a.x), Math.round(a.y), Math.round(b.x), Math.round(b.y), Math.round(c.x), Math.round(c.y));
|
|
|
-
|
|
|
+ context.clearRect(0, 0, canvas.width, canvas.height);
|
|
|
const path = new Path2D();
|
|
|
path.moveTo(Math.round(a.x), Math.round(a.y));
|
|
|
path.lineTo(Math.round(b.x), Math.round(b.y));
|