Skip to content

Commit

Permalink
Border radius is now correctly applied on the two rails.
Browse files Browse the repository at this point in the history
  • Loading branch information
casperstorm committed Feb 8, 2023
1 parent 41d1906 commit 689b76e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
19 changes: 15 additions & 4 deletions native/src/widget/slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use crate::renderer;
use crate::touch;
use crate::widget::tree::{self, Tree};
use crate::{
Clipboard, Color, Element, Layout, Length, Point, Rectangle, Shell, Size,
Widget,
Clipboard, Element, Layout, Length, Point, Rectangle, Shell, Size, Widget,
};

use std::ops::RangeInclusive;
Expand Down Expand Up @@ -409,7 +408,13 @@ pub fn draw<T, R>(
width: line_offset,
height: style.rail.size,
},
border_radius: style.rail.border_radius.into(),
border_radius: [
style.rail.border_radius,
0.0,
0.0,
style.rail.border_radius,
]
.into(),
border_width: style.rail.border_width,
border_color: style.rail.border_color,
},
Expand All @@ -424,7 +429,13 @@ pub fn draw<T, R>(
width: bounds.width - line_offset,
height: style.rail.size,
},
border_radius: style.rail.border_radius.into(),
border_radius: [
0.0,
style.rail.border_radius,
style.rail.border_radius,
0.0,
]
.into(),
border_width: style.rail.border_width,
border_color: style.rail.border_color,
},
Expand Down
20 changes: 16 additions & 4 deletions native/src/widget/vertical_slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pub use iced_style::slider::{Appearance, Handle, HandleShape, StyleSheet};
use crate::event::{self, Event};
use crate::widget::tree::{self, Tree};
use crate::{
layout, mouse, renderer, touch, Clipboard, Color, Element, Layout, Length,
Point, Rectangle, Shell, Size, Widget,
layout, mouse, renderer, touch, Clipboard, Element, Layout, Length, Point,
Rectangle, Shell, Size, Widget,
};

/// An vertical bar and a handle that selects a single value from a range of
Expand Down Expand Up @@ -401,7 +401,13 @@ pub fn draw<T, R>(
width: style.rail.size,
height: line_offset,
},
border_radius: style.rail.border_radius.into(),
border_radius: [
style.rail.border_radius,
style.rail.border_radius,
0.0,
0.0,
]
.into(),
border_width: style.rail.border_width,
border_color: style.rail.border_color,
},
Expand All @@ -416,7 +422,13 @@ pub fn draw<T, R>(
width: style.rail.size,
height: bounds.height - line_offset,
},
border_radius: style.rail.border_radius.into(),
border_radius: [
0.0,
0.0,
style.rail.border_radius,
style.rail.border_radius,
]
.into(),
border_width: style.rail.border_width,
border_color: style.rail.border_color,
},
Expand Down

0 comments on commit 689b76e

Please sign in to comment.