Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Fix rendering bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PoignardAzur committed Apr 19, 2024
1 parent 1637217 commit 442c48a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/render_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ impl RenderRoot {

// TODO - if root widget's request_anim is still set by the
// time this is called, emit a warning
self.root_layout();
if self.root.state().needs_layout {
self.root_layout();
}
if self.root.state().needs_layout {
warn!("Widget requested layout during layout pass");
self.state
Expand Down
6 changes: 1 addition & 5 deletions src/widget/widget_pod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ impl<W: Widget> WidgetPod<W> {

bc.debug_check(self.inner.short_type_name());

let inner_mouse_pos = parent_ctx
.mouse_pos
.map(|pos| pos - self.layout_rect().origin().to_vec2());

self.state.local_paint_rect = Rect::ZERO;

let new_size = self.call_widget_method_with_checks("layout", |widget_pod| {
Expand All @@ -803,7 +799,7 @@ impl<W: Widget> WidgetPod<W> {
let mut inner_ctx = LayoutCtx {
widget_state: &mut widget_pod.state,
global_state: parent_ctx.global_state,
mouse_pos: inner_mouse_pos,
mouse_pos: parent_ctx.mouse_pos,
};

widget_pod.inner.layout(&mut inner_ctx, bc)
Expand Down

0 comments on commit 442c48a

Please sign in to comment.