docs(guide): canvas paths guide edits for clarity (#30729)
* "create use paths" --> "create and use paths" * Use ES6 syntax in code example (`var` --> `const`/`let`)
This commit is contained in:
@ -5,7 +5,7 @@ title: Paths
|
||||
|
||||
Paths are the building block of drawing in Canvas. A path is just a shape. Then, the shape can be drawn on by either stroking it or filling it.
|
||||
|
||||
We can create use paths with `beginPath`, `fill`, and `stroke`.
|
||||
We can create and use paths with `beginPath`, `fill`, and `stroke`.
|
||||
|
||||
```js
|
||||
ctx.beginPath();
|
||||
@ -57,8 +57,8 @@ The first example will draw two squares, while the second will only draw one sin
|
||||
This fact leads to a common mistake in making `canvas` animations.
|
||||
|
||||
```js
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
const y = 0;
|
||||
let x = 0;
|
||||
function draw() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
|
Reference in New Issue
Block a user