Update ComputedNode for scrollbar thumbs in update_scrollbar_thumb#23612
Conversation
…b` requires all the UI components and gains a `border_radius` field. `update_scrollbar_thumb` updates its `UiGlobalTransform` and `ComputedNode` in `PostLayout`.
|
Can we have this "after" |
kfc35
left a comment
There was a problem hiding this comment.
Now that I understand the logic, this looks fine to me.
Also checked out the branch and the example looks fine.
I think it’s fine to merge with all those requirements from node merged in to ensure correctness, but I will say that I tested the example while removing BackgroundColor, BorderColor, and ScrollPosition, and the example looks fine, so that may be a sign that those are OK to remove.
I think you should probably answer @micttyoid since it still seems there may still be ambiguities by placing update_scrollbar_thumb in PostLayout. After that, this is probably OK to merge?
|
Adding to the milestone because this is needed for me to be confident in a solution for #23346. I'll finish this up tomorrow if you're busy :) |
|
Can we also rename The |
Just realised this shouldn't be in |
Nope I got it, doesn't need much |
…ollThumb`. Added a `border: UiRect` field, which is used to set the thumb's `ComputedNode::border` in `update_scrollbar_thumb`.
Done |
| thumb_node.border_radius = border_radius; | ||
| } | ||
|
|
||
| let resolve_border_val = |val: Val| { |
There was a problem hiding this comment.
Does this actually need to be two diff lambdas for thumb_physical_size.x and thumb_physical_size.y?
There was a problem hiding this comment.
It's iffy, but generally with percentage values both axes are resolved based on the horizontal width.
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
|
According to what we did this time, for the future scheduler ordering, it's worth noting that system granularity (without system set) should be fine. We have rigorous ambiguity detection, so we don't suffer much if we need to update anything. |
bevyengine#23612) # Objective Update `ComputedNode` for scrollbar thumbs in `update_scrollbar_thumb` to avoid delays and system ambiguities. ## Solution * Removed `Node` from scrollbar thumb node entities. * Renamed `CoreScrollbarThumb` to `ScrollbarThumb`. * `ScrollbarThumb` now requires all the UI components and gains `border` and `border_radius` fields. * `update_scrollbar_thumb` now updates `ScrollbarThumb` node's `UiGlobalTransform` and `ComputedNode` in `PostLayout`. ## Testing ``` cargo run --example scrollbars ``` We need a better scrollbars example, added an issue bevyengine#23622. --------- Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Objective
Update
ComputedNodefor scrollbar thumbs inupdate_scrollbar_thumbto avoid delays and system ambiguities.Solution
Nodefrom scrollbar thumb node entities.CoreScrollbarThumbtoScrollbarThumb.ScrollbarThumbnow requires all the UI components and gainsborderandborder_radiusfields.update_scrollbar_thumbnow updatesScrollbarThumbnode'sUiGlobalTransformandComputedNodeinPostLayout.Testing
We need a better scrollbars example, added an issue #23622.