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-20 15:25:37 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-20 15:25:37 +0200
commit2e9129582a88ee0758c215847b0ec49baab79f11 (patch)
tree38b842fb501588d5a1170c13ae2c29a4b8639558 /native/src/widget/vertical_slider.rs
parent4b05f42fd6d18bf572b772dd60d6a4309ea5f343 (diff)
downloadiced-2e9129582a88ee0758c215847b0ec49baab79f11.tar.gz
iced-2e9129582a88ee0758c215847b0ec49baab79f11.tar.bz2
iced-2e9129582a88ee0758c215847b0ec49baab79f11.zip
Fix sliders drawing out of their bounds
Diffstat (limited to 'native/src/widget/vertical_slider.rs')
-rw-r--r--native/src/widget/vertical_slider.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/src/widget/vertical_slider.rs b/native/src/widget/vertical_slider.rs
index 5af69676..cb2de480 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 / 2.0) * (value - range_end)
+ (bounds.height - handle_width) * (value - range_end)
/ (range_start - range_end)
};
@@ -411,7 +411,7 @@ pub fn draw<T, R>(
x: rail_x - style.rail.width / 2.0,
y: bounds.y + offset + handle_width / 2.0,
width: style.rail.width,
- height: bounds.height - offset,
+ height: bounds.height - offset - handle_width / 2.0,
},
border_radius: Default::default(),
border_width: 0.0,