···
7
7
8
8
useEffect(() => {
9
9
// Set the fixed dimensions for the canvas.
10
10
-
const width = 500;
11
11
-
const height = 500;
10
10
+
const width = 250;
11
11
+
const height = 250;
12
12
13
13
// Create engine and set gravity.
14
14
const engine = Matter.Engine.create();
···
61
61
),
62
62
// Left wall
63
63
Matter.Bodies.rectangle(
64
64
-
0,
64
64
+
width / 2,
65
65
height / 2,
66
66
wallThickness,
67
67
height,
···
136
136
<div
137
137
ref={sceneRef}
138
138
style={{
139
139
-
maxWidth: "500px",
140
140
-
maxHeight: "500px",
139
139
+
width: "250px",
140
140
+
height: "250px",
141
141
boxSizing: "border-box",
142
142
}}
143
143
/>