Fix quad glitch when rounding borders of a Slider rail

This commit is contained in:
Héctor Ramón Jiménez 2023-06-01 17:27:52 +02:00
parent ee0dd4c623
commit 66d4decc0c
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 4 additions and 10 deletions

View file

@ -367,7 +367,6 @@ pub fn draw<T, R>(
} else {
style_sheet.active(style)
};
let border_radius: [f32; 4] = style.rail.border_radius.into();
let (handle_width, handle_height, handle_border_radius) =
match style.handle.shape {
@ -404,8 +403,7 @@ pub fn draw<T, R>(
width: offset + handle_width / 2.0,
height: style.rail.width,
},
border_radius: [border_radius[0], 0.0, 0.0, border_radius[3]]
.into(),
border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
@ -420,8 +418,7 @@ pub fn draw<T, R>(
width: bounds.width - offset - handle_width / 2.0,
height: style.rail.width,
},
border_radius: [0.0, border_radius[1], border_radius[2], 0.0]
.into(),
border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},

View file

@ -365,7 +365,6 @@ pub fn draw<T, R>(
} else {
style_sheet.active(style)
};
let border_radius: [f32; 4] = style.rail.border_radius.into();
let (handle_width, handle_height, handle_border_radius) =
match style.handle.shape {
@ -402,8 +401,7 @@ pub fn draw<T, R>(
width: style.rail.width,
height: offset + handle_width / 2.0,
},
border_radius: [border_radius[0], border_radius[1], 0.0, 0.0]
.into(),
border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
@ -418,8 +416,7 @@ pub fn draw<T, R>(
width: style.rail.width,
height: bounds.height - offset - handle_width / 2.0,
},
border_radius: [0.0, 0.0, border_radius[2], border_radius[3]]
.into(),
border_radius: style.rail.border_radius,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},