Skip to content

Commit

Permalink
Up docs api
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Mar 9, 2024
1 parent a82360e commit 1c65d37
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/api/canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c65d37

Please sign in to comment.