Skip to content

Commit 66d4dec

Browse files
committed
Fix quad glitch when rounding borders of a Slider rail
1 parent ee0dd4c commit 66d4dec

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

widget/src/slider.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ pub fn draw<T, R>(
367367
} else {
368368
style_sheet.active(style)
369369
};
370-
let border_radius: [f32; 4] = style.rail.border_radius.into();
371370

372371
let (handle_width, handle_height, handle_border_radius) =
373372
match style.handle.shape {
@@ -404,8 +403,7 @@ pub fn draw<T, R>(
404403
width: offset + handle_width / 2.0,
405404
height: style.rail.width,
406405
},
407-
border_radius: [border_radius[0], 0.0, 0.0, border_radius[3]]
408-
.into(),
406+
border_radius: style.rail.border_radius,
409407
border_width: 0.0,
410408
border_color: Color::TRANSPARENT,
411409
},
@@ -420,8 +418,7 @@ pub fn draw<T, R>(
420418
width: bounds.width - offset - handle_width / 2.0,
421419
height: style.rail.width,
422420
},
423-
border_radius: [0.0, border_radius[1], border_radius[2], 0.0]
424-
.into(),
421+
border_radius: style.rail.border_radius,
425422
border_width: 0.0,
426423
border_color: Color::TRANSPARENT,
427424
},

widget/src/vertical_slider.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ pub fn draw<T, R>(
365365
} else {
366366
style_sheet.active(style)
367367
};
368-
let border_radius: [f32; 4] = style.rail.border_radius.into();
369368

370369
let (handle_width, handle_height, handle_border_radius) =
371370
match style.handle.shape {
@@ -402,8 +401,7 @@ pub fn draw<T, R>(
402401
width: style.rail.width,
403402
height: offset + handle_width / 2.0,
404403
},
405-
border_radius: [border_radius[0], border_radius[1], 0.0, 0.0]
406-
.into(),
404+
border_radius: style.rail.border_radius,
407405
border_width: 0.0,
408406
border_color: Color::TRANSPARENT,
409407
},
@@ -418,8 +416,7 @@ pub fn draw<T, R>(
418416
width: style.rail.width,
419417
height: bounds.height - offset - handle_width / 2.0,
420418
},
421-
border_radius: [0.0, 0.0, border_radius[2], border_radius[3]]
422-
.into(),
419+
border_radius: style.rail.border_radius,
423420
border_width: 0.0,
424421
border_color: Color::TRANSPARENT,
425422
},

0 commit comments

Comments
 (0)