From 1c65d37419d5040c2ecdcd180da0875b0af9102c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 9 Mar 2024 14:20:14 +0400 Subject: [PATCH] Up docs api --- docs/api/canvas.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/api/canvas.md b/docs/api/canvas.md index bbdd350f1d..8439a7ebb2 100644 --- a/docs/api/canvas.md +++ b/docs/api/canvas.md @@ -90,6 +90,14 @@ editor.on('canvas:pointer', () => { }); ``` +* `canvas:refresh` Canvas was refreshed to update elements on top, like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize). + +```javascript +editor.on('canvas:refresh', (canvasRefreshOptions) => { + console.log('Canvas refreshed with options:', canvasRefreshOptions); +}); +``` + * `canvas:frame:load` Frame loaded in canvas. The event is triggered right after iframe's `onload`. ```javascript @@ -396,6 +404,16 @@ Transform a box rect from the world coordinate system to the screen one. Returns **[Object][2]** +## refresh + +Update canvas for spots/tools positioning. + +### Parameters + +* `opts` **[Object][2]?** Options. (optional, default `{}`) + + * `opts.spots` **[Object][2]** Update the position of spots. (optional, default `false`) + [1]: https://github.com/GrapesJS/grapesjs/blob/master/src/canvas/config/config.ts [2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object