Improve UI update_clipping_system comments#8147
Conversation
crates/bevy_ui/src/update.rs
Outdated
| (Some(mut old_clip), Some(clip)) => { | ||
| if old_clip.clip != clip { | ||
| *old_clip = CalculatedClip { clip }; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
I was going to suggest to use set_if_neq but then I checked and we never actually query for changes in CalculatedClip so the neq gate is unnecessary:
| (Some(mut old_clip), Some(clip)) => { | |
| if old_clip.clip != clip { | |
| *old_clip = CalculatedClip { clip }; | |
| } | |
| } | |
| } | |
| (Some(mut calculated_clip), Some(inherited_clip)) => *calculated_clip = CalculatedClip { inherited_clip }, | |
| } |
|
#8095 that is very related needs some reviews, be grateful if you have a few minutes spare to look at it. |
|
Thanks for the comments! I was going to review them, but suddenly I'm getting a segfault out of nowhere. So frustrating. The good thing is that I can learn how this kind of stuff is debugged. Anyway, sure I can check #8095. Btw, I want to review more UI PRs (mostly yours and nico's), but first I want to finish reading the UI related code. I did few reviews last couple of weeks but I realized I was lacking understanding. ^_^ |
Co-Authored-By: ickshonpe <27962798+ickshonpe@users.noreply.github.com>
|
@ickshonpe I've applied most of the suggestions. I think I'm going to skip #8147 (comment) I prefer not to touch that part. In any case, I've asked about it in https://github.com/bevyengine/bevy/pull/8095/files#r1144342397, we can follow there. |
Objective
update_clipping_systemcommentsSolution
CalculatedClipupdatingmatchso it's reads(old, new)vs previous(new, old)cloneon children iteration