Skip to content

Commit

Permalink
build(deps): bump the wasm-bindgen group with 3 updates
Browse files Browse the repository at this point in the history
Bumps the wasm-bindgen group with 3 updates:
[js-sys](https://github.com/rustwasm/wasm-bindgen),
[web-sys](https://github.com/rustwasm/wasm-bindgen) and
[wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen).

Updates `js-sys` from 0.3.70 to 0.3.72
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
-
[Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `web-sys` from 0.3.70 to 0.3.72
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
-
[Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `wasm-bindgen-futures` from 0.4.43 to 0.4.45
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
-
[Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasm-bindgen
- dependency-name: web-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasm-bindgen
- dependency-name: wasm-bindgen-futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasm-bindgen
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Kamil Jarosz <[email protected]>
  • Loading branch information
2 people authored and torokati44 committed Oct 21, 2024
1 parent 2c87be2 commit 64a5c01
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 37 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ enum-map = "2.7.3"
flate2 = "1.0.34"
futures = "0.3.31"
image = { version = "0.25.4", default-features = false }
js-sys = "0.3.70"
web-sys = "0.3.70"
js-sys = "0.3.72"
web-sys = "0.3.72"
log = "0.4"
num-derive = "0.4.2"
num-traits = "0.2.19"
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ tracy-client = { version = "0.17.1", optional = true, default-features = false }
workspace = true

[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen-futures]
version = "0.4.43"
version = "0.4.45"

[features]
default = []
Expand Down
51 changes: 24 additions & 27 deletions render/canvas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,13 @@ impl WebCanvasRenderBackend {
self.context.set_line_cap("butt");
self.context.set_line_width(1.0);
self.context.set_line_join("miter");
self.context.set_stroke_style(
&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0,
)
.into(),
);
self.context.set_stroke_style_str(&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0,
));
}

fn apply_blend_mode(&mut self, blend: RenderBlendMode) {
Expand Down Expand Up @@ -429,7 +426,7 @@ impl WebCanvasRenderBackend {

if clear.a > 0 {
let color = format!("rgba({}, {}, {}, {})", clear.r, clear.g, clear.b, clear.a);
self.context.set_fill_style(&color.into());
self.context.set_fill_style_str(&color);
let _ = self.context.set_global_composite_operation("copy");
self.context
.fill_rect(0.0, 0.0, width.into(), height.into());
Expand Down Expand Up @@ -651,15 +648,16 @@ impl CommandHandler for WebCanvasRenderBackend {
match fill_style {
CanvasFillStyle::Color(color) => {
let color = color.color_transform(&transform.color_transform);
self.context.set_fill_style(&color.1.into());
self.context.set_fill_style_str(&color.1);
self.context.fill_with_path_2d_and_winding(
path,
CanvasWindingRule::Evenodd,
);
}
CanvasFillStyle::Gradient(gradient) => {
self.set_color_filter(&transform);
self.context.set_fill_style(&gradient.gradient);
self.context
.set_fill_style_canvas_gradient(&gradient.gradient);

if let Some(gradient_transform) = &gradient.transform {
// Canvas has no easy way to draw gradients with an arbitrary transform,
Expand Down Expand Up @@ -693,7 +691,7 @@ impl CommandHandler for WebCanvasRenderBackend {
CanvasFillStyle::Bitmap(bitmap) => {
self.set_color_filter(&transform);
self.context.set_image_smoothing_enabled(bitmap.smoothed);
self.context.set_fill_style(&bitmap.pattern);
self.context.set_fill_style_canvas_pattern(&bitmap.pattern);
self.context.fill_with_path_2d_and_winding(
path,
CanvasWindingRule::Evenodd,
Expand Down Expand Up @@ -731,7 +729,7 @@ impl CommandHandler for WebCanvasRenderBackend {
match stroke_style {
CanvasStrokeStyle::Color(color) => {
let color = color.color_transform(&transform.color_transform);
self.context.set_stroke_style(&color.1.into());
self.context.set_stroke_style_str(&color.1);
self.context.stroke_with_path(&transformed_path);
}
CanvasStrokeStyle::Gradient(gradient, focal_point) => {
Expand Down Expand Up @@ -759,7 +757,8 @@ impl CommandHandler for WebCanvasRenderBackend {
};
if let Ok(gradient) = gradient {
self.set_color_filter(&transform);
self.context.set_stroke_style(&gradient.gradient);
self.context
.set_stroke_style_canvas_gradient(&gradient.gradient);
self.context.stroke_with_path(&transformed_path);
self.clear_color_filter();
}
Expand All @@ -774,7 +773,8 @@ impl CommandHandler for WebCanvasRenderBackend {
);
self.set_color_filter(&transform);
self.context.set_image_smoothing_enabled(bitmap.smoothed);
self.context.set_stroke_style(&bitmap.pattern);
self.context
.set_stroke_style_canvas_pattern(&bitmap.pattern);
self.context.stroke_with_path(&transformed_path);
self.clear_color_filter();
}
Expand Down Expand Up @@ -807,16 +807,13 @@ impl CommandHandler for WebCanvasRenderBackend {
MaskState::DrawContent => {
self.set_transform(&matrix);
self.clear_color_filter();
self.context.set_fill_style(
&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0
)
.into(),
);
self.context.set_fill_style_str(&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0
));
self.context.fill_rect(0.0, 0.0, 1.0, 1.0);
}
MaskState::DrawMask(mask_path) => {
Expand Down
2 changes: 1 addition & 1 deletion web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ruffle_render_wgpu = { path = "../render/wgpu", optional = true }
ruffle_video_software = { path = "../video/software" }
url = { workspace = true }
wasm-bindgen = { workspace = true }
wasm-bindgen-futures = "0.4.43"
wasm-bindgen-futures = "0.4.45"
serde-wasm-bindgen = "0.6.5"
chrono = { workspace = true, features = ["wasmbind", "clock"] }
getrandom = { version = "0.2", features = ["js"] }
Expand Down

0 comments on commit 64a5c01

Please sign in to comment.