Added scrollbar_size field to ComputedNode.

Added `scrollbar_width` field to `Node`.
This commit is contained in:
ickshonpe 2025-07-11 15:34:50 +01:00
parent cb64a4aa8a
commit d22acb2a9a

View File

@ -42,6 +42,10 @@ pub struct ComputedNode {
///
/// Automatically calculated by [`super::layout::ui_layout_system`].
pub content_size: Vec2,
/// Space allocated for scrollbars.
///
/// Automatically calculated by [`super::layout::ui_layout_system`].
pub scrollbar_size: Vec2,
/// The width of this node's outline.
/// If this value is `Auto`, negative or `0.` then no outline will be rendered.
/// Outline updates bypass change detection.
@ -305,6 +309,7 @@ impl ComputedNode {
stack_index: 0,
size: Vec2::ZERO,
content_size: Vec2::ZERO,
scrollbar_size: Vec2::ZERO,
outline_width: 0.,
outline_offset: 0.,
unrounded_size: Vec2::ZERO,
@ -419,6 +424,9 @@ pub struct Node {
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/overflow>
pub overflow: Overflow,
/// How much space in logical pixels should be reserved for scrollbars when overflow is set to scroll or auto on an axis.
pub scrollbar_width: f32,
/// How the bounds of clipped content should be determined
///
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-margin>
@ -703,6 +711,7 @@ impl Node {
aspect_ratio: None,
overflow: Overflow::DEFAULT,
overflow_clip_margin: OverflowClipMargin::DEFAULT,
scrollbar_width: 0.,
row_gap: Val::ZERO,
column_gap: Val::ZERO,
grid_auto_flow: GridAutoFlow::DEFAULT,