Skip to content

Commit dc43129

Browse files
committed
update engine
1 parent e2fdef2 commit dc43129

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/about.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,17 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
252252
// restore the canvas context
253253
pop(): void
254254

255+
// create a clipping region using a path
256+
// example: clip((ctx) => ctx.arc(100, 100, 50, 0, PI * 2))
257+
// note: Clip paths cannot be reverted directly. You must save your
258+
// canvas state using push() before calling clip(), and restore it
259+
// once you have finished drawing in the clipped area using pop().
260+
// see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip
261+
clip(callback: function): void
262+
255263
// update the transformation matrix
256264
// note: angle in radians
257-
transform(translateX, translateY, scale = 1, angle = 0): void
265+
transform(translateX: number, translateY: number, scale = 1, angle = 0): void
258266

259267
// update the alpha (transparency)
260268
// see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha

0 commit comments

Comments
 (0)