feat(#3843): Add support for CanvasState.reset (#3844)

This commit is contained in:
Nulled 2024-02-10 09:00:36 +01:00 committed by GitHub
parent db91cc2a28
commit a396d03d9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,9 @@
* Add bindings for `RTCPeerConnectionIceErrorEvent`.
[#3835](https://github.com/rustwasm/wasm-bindgen/pull/3835)
* Add bindings for `CanvasState.reset()`, affecting `CanvasRenderingContext2D` and `OffscreenCanvasRenderingContext2D`.
[#3844](https://github.com/rustwasm/wasm-bindgen/pull/3844)
--------------------------------------------------------------------------------
## [0.2.91](https://github.com/rustwasm/wasm-bindgen/compare/0.2.90...0.2.91)

View File

@ -1266,6 +1266,13 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
pub fn stroke_rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64);
# [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = reset)]
#[doc = "The `reset()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/reset)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
pub fn reset(this: &CanvasRenderingContext2d);
# [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = restore)]
#[doc = "The `restore()` method."]
#[doc = ""]

View File

@ -1222,6 +1222,13 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"]
pub fn stroke_rect(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64);
# [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = reset)]
#[doc = "The `reset()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/reset)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"]
pub fn reset(this: &OffscreenCanvasRenderingContext2d);
# [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = restore)]
#[doc = "The `restore()` method."]
#[doc = ""]

View File

@ -131,6 +131,7 @@ interface mixin CanvasState {
// state
undefined save(); // push state on state stack
undefined restore(); // pop state stack and restore state
undefined reset(); // clears the backing buffer, drawing state stack, any defined paths, and styles
};
interface mixin CanvasTransform {