Checks moved to Element::client_rect(), fixed conditions for the special cases, reconfigured Window constructor to initialize current_viewport to initial window size

This commit is contained in:
switchpiggy 2023-05-05 01:56:27 -07:00
parent bf49260e81
commit 7c61c5b930
2 changed files with 34 additions and 24 deletions

View file

@ -2609,7 +2609,13 @@ impl Window {
layout_chan,
layout_rpc,
window_size: Cell::new(window_size),
current_viewport: Cell::new(Rect::zero()),
current_viewport: Cell::new(Rect::new(
Point2D::zero(),
Size2D::new(
Au::from_f32_px(window_size.initial_viewport.width.into()),
Au::from_f32_px(window_size.initial_viewport.width.into()),
),
)),
suppress_reflow: Cell::new(true),
pending_reflow_count: Default::default(),
current_state: Cell::new(WindowState::Alive),