-
Notifications
You must be signed in to change notification settings - Fork 145
Update code which handles stashing #1150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d21eb4f
to
96e2781
Compare
@@ -39,7 +44,7 @@ fn paint_widget( | |||
widget_children: widget.children.reborrow_mut(), | |||
debug_paint, | |||
}; | |||
if ctx.widget_state.request_paint { | |||
if ctx.widget_state.request_paint && !is_stashed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there should be a debug assert to ensure that we aren't seeing something happen where request_paint
is true but it was stashed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that case is fine. For example, if you change a stashed widget's background color, it's going to request repaint, and the request will be ignored.
let transform = state.item.window_transform; | ||
let scene = scenes.get(&id).unwrap(); | ||
let has_clip = state.item.clip_path.is_some(); | ||
if !is_stashed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know ... it just feels like if the widget its stashed, maybe it shouldn't even be getting this far and wanting to do all of this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end the only work it does is resetting needs_paint
flags.
This will probably be rebased on top of #1179. |
d166fcc
to
918cd95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
state.children, | ||
properties.children, | ||
|widget, state, properties| { | ||
clear_layout_flags(widget, state, properties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be correct to debug_assert
that state.item.is_stashed
is true here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be correct, yeah.
Avoids the panic in #1119.