diff --git a/crates/bevy_core_widgets/src/core_slider.rs b/crates/bevy_core_widgets/src/core_slider.rs index d7ab387852..e07a61a9c2 100644 --- a/crates/bevy_core_widgets/src/core_slider.rs +++ b/crates/bevy_core_widgets/src/core_slider.rs @@ -211,6 +211,7 @@ pub(crate) fn slider_on_pointer_down( focus: Option>, focus_visible: Option>, mut commands: Commands, + ui_scale: Res, ) { if q_thumb.contains(trigger.target()) { // Thumb click, stop propagation to prevent track click. @@ -255,7 +256,7 @@ pub(crate) fn slider_on_pointer_down( // Detect track click. let local_pos = transform.try_inverse().unwrap().transform_point2( - trigger.event().pointer_location.position * node_target.scale_factor(), + trigger.event().pointer_location.position * node_target.scale_factor() / ui_scale.0, ); let track_width = node.size().x - thumb_size; // Avoid division by zero