From 882679ef575f519ddb80095398a1235415ac01f1 Mon Sep 17 00:00:00 2001 From: BlobTheKat <64211737+BlobTheKat@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:37:40 +0100 Subject: [PATCH] Add note that clip() cannot be reverted without save() and restore() (#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 --- files/en-us/web/api/canvasrenderingcontext2d/clip/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/en-us/web/api/canvasrenderingcontext2d/clip/index.md b/files/en-us/web/api/canvasrenderingcontext2d/clip/index.md index 02fac97d6e0288f..a9892c031c33137 100644 --- a/files/en-us/web/api/canvasrenderingcontext2d/clip/index.md +++ b/files/en-us/web/api/canvasrenderingcontext2d/clip/index.md @@ -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