From c0e10f2e9d090e0ce63c00b4fa32cb5103470b30 Mon Sep 17 00:00:00 2001 From: MG_REX <49415741+ThisIsRex@users.noreply.github.com> Date: Tue, 15 Mar 2022 22:42:58 +0300 Subject: Fix slider's handle position calculation --- native/src/widget/slider.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'native') diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs index 4c56083e..f2e84ea9 100644 --- a/native/src/widget/slider.rs +++ b/native/src/widget/slider.rs @@ -258,7 +258,7 @@ pub fn draw( renderer::Quad { bounds: Rectangle { x: bounds.x, - y: rail_y, + y: rail_y - 1.0, width: bounds.width, height: 2.0, }, @@ -273,7 +273,7 @@ pub fn draw( renderer::Quad { bounds: Rectangle { x: bounds.x, - y: rail_y + 2.0, + y: rail_y + 1.0, width: bounds.width, height: 2.0, }, @@ -305,8 +305,8 @@ pub fn draw( let handle_offset = if range_start >= range_end { 0.0 } else { - (bounds.width - handle_width) * (value - range_start) - / (range_end - range_start) + bounds.width * (value - range_start) / (range_end - range_start) + - handle_width / 2.0 }; renderer.fill_quad( -- cgit