fix: slider rendering

This commit is contained in:
Ashley Wulber 2024-10-22 14:28:24 -04:00
parent a926290efb
commit cb529219ab
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -526,7 +526,7 @@ where
let radius = (radius)
.max(2.0 * border_width)
.min(bounds.height / 2.0)
.min(bounds.width / 2.0);
.min(bounds.width / 2.0 + 2.0 * border_width);
(radius * 2.0, radius * 2.0, Radius::from(radius))
}
HandleShape::Rectangle {
@ -534,12 +534,8 @@ where
width,
border_radius,
} => {
let width = (f32::from(width))
.max(2.0 * border_width)
.min(bounds.width);
let height = (f32::from(height))
.max(2.0 * border_width)
.min(bounds.height);
let width = (f32::from(width)).max(2.0 * border_width);
let height = (f32::from(height)).max(2.0 * border_width);
let mut border_radius: [f32; 4] = border_radius.into();
for r in &mut border_radius {
*r = (*r)
@ -626,23 +622,9 @@ where
renderer.fill_quad(
renderer::Quad {
bounds: Rectangle {
x: bounds.x,
x: bounds.x + offset + handle_width / 2.0,
y: rail_y - style.rail.width / 2.0,
width: offset + handle_width / 2.0,
height: style.rail.width,
},
border: style.rail.border,
..renderer::Quad::default()
},
style.rail.backgrounds.0,
);
renderer.fill_quad(
renderer::Quad {
bounds: Rectangle {
x: bounds.x,
y: rail_y - style.rail.width / 2.0,
width: offset + handle_width / 2.0,
width: bounds.width - offset - handle_width / 2.0,
height: style.rail.width,
},
border: style.rail.border,