Skip to content

Commit 9eb72b3

Browse files
authored
Set feather's slider's text to use absolute positioning (#20909)
# Objective The slider value label's container isn't absolutely positioned, which causes the slider to expand if the label becomes wider than the slider ## Solution Set it to use absolute positioning.
1 parent 20e2515 commit 9eb72b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/bevy_feathers/src/controls/slider.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use bevy_picking::PickingSystems;
2121
use bevy_reflect::{prelude::ReflectDefault, Reflect};
2222
use bevy_ui::{
2323
widget::Text, AlignItems, BackgroundGradient, ColorStop, Display, FlexDirection, Gradient,
24-
InteractionDisabled, InterpolationColorSpace, JustifyContent, LinearGradient, Node, UiRect,
25-
Val,
24+
InteractionDisabled, InterpolationColorSpace, JustifyContent, LinearGradient, Node,
25+
PositionType, UiRect, Val,
2626
};
2727

2828
use crate::{
@@ -111,6 +111,7 @@ pub fn slider<B: Bundle>(props: SliderProps, overrides: B) -> impl Bundle {
111111
// Text container
112112
Node {
113113
display: Display::Flex,
114+
position_type: PositionType::Absolute,
114115
flex_direction: FlexDirection::Row,
115116
align_items: AlignItems::Center,
116117
justify_content: JustifyContent::Center,

0 commit comments

Comments
 (0)