Skip to content

Commit

Permalink
Merge pull request #1996 from iced-rs/fix/wgpu-freeze
Browse files Browse the repository at this point in the history
Fix `iced_wgpu` freezing on empty layers
  • Loading branch information
hecrj authored Aug 2, 2023
2 parents 50ce65b + 4dfa2f0 commit f7ca420
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Tooltip` overlay position inside `Scrollable`. [#1978](https://github.com/iced-rs/iced/pull/1978)
- `BorderRadius` not exposed in root crate. [#1972](https://github.com/iced-rs/iced/pull/1972)
- Outdated `ROADMAP`. [#1958](https://github.com/iced-rs/iced/pull/1958)
- `iced_wgpu` freezing on empty layers. [#1996](https://github.com/iced-rs/iced/pull/1996)

Many thanks to...

Expand Down
7 changes: 5 additions & 2 deletions wgpu/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ impl Backend {
let transformation = viewport.projection();

let mut layers = Layer::generate(primitives, viewport);
layers.push(Layer::overlay(overlay_text, viewport));

if !overlay_text.is_empty() {
layers.push(Layer::overlay(overlay_text, viewport));
}

self.prepare(
device,
Expand Down Expand Up @@ -236,7 +239,7 @@ impl Backend {
let bounds = (layer.bounds * scale_factor).snap();

if bounds.width < 1 || bounds.height < 1 {
return;
continue;
}

if !layer.quads.is_empty() {
Expand Down

0 comments on commit f7ca420

Please sign in to comment.