Skip to content

Commit

Permalink
Add note that clip() cannot be reverted without save() and restore() (m…
Browse files Browse the repository at this point in the history
…dn#27302)

* Update index.md

Add note that `clip()` cannot be reverted without `save()` and `restore()`

* Update index.md

domxref

* Update files/en-us/web/api/canvasrenderingcontext2d/clip/index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
BlobTheKat and Josh-Cena authored Sep 15, 2023
1 parent 5a2cea7 commit 882679e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/en-us/web/api/canvasrenderingcontext2d/clip/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ drawn.
> Instead, you'd have to use {{domxref("CanvasRenderingContext2D.rect()","rect()")}} to
> add a rectangular shape to the path before calling `clip()`.
> **Note:** Clip paths cannot be reverted directly. You must save your canvas state using {{domxref("CanvasRenderingContext2D/save", "save()")}} before calling `clip()`, and restore it once you have finished drawing in the clipped area using {{domxref("CanvasRenderingContext2D/restore", "restore()")}}.
## Syntax

```js-nolint
Expand Down

0 comments on commit 882679e

Please sign in to comment.