Skip to content

Commit

Permalink
Preserve order of overlays when removing one.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Mar 30, 2024
1 parent 23445ad commit 48d5a9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Expose `winit` support for `WindowTouchpadMagnifyEvent` and `WindowTouchpadRotateEvent` on supported platforms.
* Bump minimum `tch` version to `0.13.0`.
* Bump supported `image` version to `0.25`.
* Preserve order of overlays when removing one.

# v0.13.1 - 2022-09-16
* Tweak the behavior of `set_overlay` to preserve visibility of existing overlays.
Expand Down
2 changes: 1 addition & 1 deletion src/backend/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl<'a> WindowHandle<'a> {
///
/// Returns `true` if there was an overlay to remove.
pub fn remove_overlay(&mut self, name: &impl AsRef<str>) -> bool {
let removed = self.window_mut().overlays.remove(name.as_ref()).is_some();
let removed = self.window_mut().overlays.shift_remove(name.as_ref()).is_some();
self.window().window.request_redraw();
removed
}
Expand Down

0 comments on commit 48d5a9b

Please sign in to comment.