Skip to content

Commit

Permalink
Merge pull request #1206 from iced-rs/fix/responsive-window-resize
Browse files Browse the repository at this point in the history
Invalidate widget tree in `Responsive` after a `window::Event::Resized`
  • Loading branch information
hecrj authored Jan 20, 2022
2 parents a1311bc + 0e475b0 commit 5a1638a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lazy/src/responsive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use iced_native::layout::{self, Layout};
use iced_native::mouse;
use iced_native::overlay;
use iced_native::renderer;
use iced_native::window;
use iced_native::{
Clipboard, Element, Hasher, Length, Point, Rectangle, Shell, Size, Widget,
};
Expand Down Expand Up @@ -100,7 +101,10 @@ where
) -> event::Status {
let mut internal = self.0.borrow_mut();

if internal.state.last_size != Some(internal.state.last_layout.size()) {
if matches!(event, Event::Window(window::Event::Resized { .. }))
|| internal.state.last_size
!= Some(internal.state.last_layout.size())
{
shell.invalidate_widgets();
}

Expand Down

0 comments on commit 5a1638a

Please sign in to comment.