Make toggler always perfectly round
This commit is contained in:
parent
b2aa8794b8
commit
686c008dc8
1 changed files with 1 additions and 4 deletions
|
|
@ -394,9 +394,6 @@ where
|
||||||
_cursor: mouse::Cursor,
|
_cursor: mouse::Cursor,
|
||||||
viewport: &Rectangle,
|
viewport: &Rectangle,
|
||||||
) {
|
) {
|
||||||
/// Makes sure that the border radius of the toggler looks good at every size.
|
|
||||||
const BORDER_RADIUS_RATIO: f32 = 32.0 / 13.0;
|
|
||||||
|
|
||||||
/// The space ratio between the background Quad and the Toggler bounds, and
|
/// The space ratio between the background Quad and the Toggler bounds, and
|
||||||
/// between the background Quad and foreground Quad.
|
/// between the background Quad and foreground Quad.
|
||||||
const SPACE_RATIO: f32 = 0.05;
|
const SPACE_RATIO: f32 = 0.05;
|
||||||
|
|
@ -423,7 +420,7 @@ where
|
||||||
let style = theme
|
let style = theme
|
||||||
.style(&self.class, self.last_status.unwrap_or(Status::Disabled));
|
.style(&self.class, self.last_status.unwrap_or(Status::Disabled));
|
||||||
|
|
||||||
let border_radius = bounds.height / BORDER_RADIUS_RATIO;
|
let border_radius = bounds.height / 2.0;
|
||||||
let space = (SPACE_RATIO * bounds.height).round();
|
let space = (SPACE_RATIO * bounds.height).round();
|
||||||
|
|
||||||
let toggler_background_bounds = Rectangle {
|
let toggler_background_bounds = Rectangle {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue