質問編集履歴
2
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,15 +10,15 @@
|
|
10
10
|
|
11
11
|
```JavaScript
|
12
12
|
|
13
|
-
const canvas = document.getElementById(
|
13
|
+
const canvas = document.getElementById("canvas");
|
14
14
|
|
15
|
-
const c = canvas.getContext(
|
15
|
+
const c = canvas.getContext("2d");
|
16
16
|
|
17
17
|
|
18
18
|
|
19
19
|
let Circle = function(x, y, radius){
|
20
20
|
|
21
|
-
this
|
21
|
+
this.x = x;
|
22
22
|
|
23
23
|
this.y = y;
|
24
24
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
c.arc(this.x, this.y, 10, Math.PI * 2, false);
|
34
34
|
|
35
|
-
c.fillStyle =
|
35
|
+
c.fillStyle = "red";
|
36
36
|
|
37
37
|
c.fill();
|
38
38
|
|
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
|
56
56
|
|
57
|
-
canvas.addEventListener(
|
57
|
+
canvas.addEventListener("mousemove", function(event){
|
58
58
|
|
59
59
|
let canvasRect = canvas.getBoundingClientRect();
|
60
60
|
|
1
誤植
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
const canvas = document.getElementById(“canvas);
|
14
14
|
|
15
|
-
|
15
|
+
const c = canvas.getContext(“2d”);
|
16
16
|
|
17
17
|
|
18
18
|
|
@@ -102,6 +102,6 @@
|
|
102
102
|
|
103
103
|
init();
|
104
104
|
|
105
|
-
|
105
|
+
animate();
|
106
106
|
|
107
107
|
```
|