summaryrefslogtreecommitdiffstats
path: root/native/src/widget/vertical_slider.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-13 06:02:30 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-13 06:02:30 +0200
commit2be79d7b6be377c26f2d328058177179377fba46 (patch)
tree86dd19cfb9d12f92779fc6f188bd53c720bf10c5 /native/src/widget/vertical_slider.rs
parent52c84c4975d75baf313243d422d96581daca19bf (diff)
downloadiced-2be79d7b6be377c26f2d328058177179377fba46.tar.gz
iced-2be79d7b6be377c26f2d328058177179377fba46.tar.bz2
iced-2be79d7b6be377c26f2d328058177179377fba46.zip
Fix handle position of sliders
Diffstat (limited to 'native/src/widget/vertical_slider.rs')
-rw-r--r--native/src/widget/vertical_slider.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/native/src/widget/vertical_slider.rs b/native/src/widget/vertical_slider.rs
index b445b9ec..5af69676 100644
--- a/native/src/widget/vertical_slider.rs
+++ b/native/src/widget/vertical_slider.rs
@@ -384,7 +384,7 @@ pub fn draw<T, R>(
let offset = if range_start >= range_end {
0.0
} else {
- (bounds.height - handle_width) * (value - range_end)
+ (bounds.height - handle_width / 2.0) * (value - range_end)
/ (range_start - range_end)
};
@@ -396,7 +396,7 @@ pub fn draw<T, R>(
x: rail_x - style.rail.width / 2.0,
y: bounds.y,
width: style.rail.width,
- height: offset,
+ height: offset + handle_width / 2.0,
},
border_radius: Default::default(),
border_width: 0.0,
@@ -409,7 +409,7 @@ pub fn draw<T, R>(
renderer::Quad {
bounds: Rectangle {
x: rail_x - style.rail.width / 2.0,
- y: bounds.y + offset,
+ y: bounds.y + offset + handle_width / 2.0,
width: style.rail.width,
height: bounds.height - offset,
},
@@ -424,7 +424,7 @@ pub fn draw<T, R>(
renderer::Quad {
bounds: Rectangle {
x: rail_x - handle_height / 2.0,
- y: bounds.y + offset.round(),
+ y: bounds.y + offset,
width: handle_height,
height: handle_width,
},