summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-03-29 19:23:44 +0700
committerLibravatar GitHub <noreply@github.com>2022-03-29 19:23:44 +0700
commit662c76488bc242457ae6a3da9748fbac23647b19 (patch)
treed770298ab4e451baf3996e3c6223a3b92da123fe /native/src/widget
parent13a2997debef25570e8c14a52456aec1e7425ec6 (diff)
parentc0e10f2e9d090e0ce63c00b4fa32cb5103470b30 (diff)
downloadiced-662c76488bc242457ae6a3da9748fbac23647b19.tar.gz
iced-662c76488bc242457ae6a3da9748fbac23647b19.tar.bz2
iced-662c76488bc242457ae6a3da9748fbac23647b19.zip
Merge pull request #1286 from ThisIsRex/master
Slider fix
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/slider.rs8
1 files changed, 4 insertions, 4 deletions
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<T>(
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<T>(
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<T>(
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(