Use f32 for border_width and border_radius

This commit is contained in:
Héctor Ramón Jiménez 2020-11-23 00:31:50 +01:00
parent ea1a7248d2
commit f41eacc3dc
32 changed files with 134 additions and 134 deletions

View file

@ -66,7 +66,7 @@ where
);
(
if styling.background.is_some() || styling.border_width > 0 {
if styling.background.is_some() || styling.border_width > 0.0 {
let background = Primitive::Quad {
bounds,
background: styling
@ -93,7 +93,7 @@ where
[0.0, 0.0, 0.0, 0.5].into(),
),
border_radius: styling.border_radius,
border_width: 0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
};

View file

@ -62,7 +62,7 @@ pub(crate) fn background(
bounds: Rectangle,
style: &container::Style,
) -> Option<Primitive> {
if style.background.is_some() || style.border_width > 0 {
if style.background.is_some() || style.border_width > 0.0 {
Some(Primitive::Quad {
bounds,
background: style

View file

@ -43,7 +43,7 @@ where
bounds: Rectangle { ..bounds },
background: style.background,
border_radius: style.border_radius,
border_width: 0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
}],
};
@ -57,7 +57,7 @@ where
},
background: style.bar,
border_radius: style.border_radius,
border_width: 0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
};

View file

@ -42,7 +42,7 @@ where
let radio = Primitive::Quad {
bounds,
background: style.background,
border_radius: (size / 2.0) as u16,
border_radius: size / 2.0,
border_width: style.border_width,
border_color: style.border_color,
};
@ -58,8 +58,8 @@ where
height: bounds.height - dot_size,
},
background: Background::Color(style.dot_color),
border_radius: (dot_size / 2.0) as u16,
border_width: 0,
border_radius: dot_size / 2.0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
};

View file

@ -43,7 +43,7 @@ where
},
background: Background::Color(style.color),
border_radius: style.radius,
border_width: 0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
}
} else {
@ -63,7 +63,7 @@ where
},
background: Background::Color(style.color),
border_radius: style.radius,
border_width: 0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
}
};

View file

@ -103,7 +103,7 @@ where
};
let is_scrollbar_visible =
style.background.is_some() || style.border_width > 0;
style.background.is_some() || style.border_width > 0.0;
let scroller = if is_mouse_over
|| state.is_scroller_grabbed()

View file

@ -57,8 +57,8 @@ where
height: 2.0,
},
background: Background::Color(style.rail_colors.0),
border_radius: 0,
border_width: 0,
border_radius: 0.0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
Primitive::Quad {
@ -69,8 +69,8 @@ where
height: 2.0,
},
background: Background::Color(style.rail_colors.1),
border_radius: 0,
border_width: 0,
border_radius: 0.0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
);
@ -82,7 +82,7 @@ where
.shape
{
HandleShape::Circle { radius } => {
(f32::from(radius * 2), f32::from(radius * 2), radius)
(radius * 2.0, radius * 2.0, radius)
}
HandleShape::Rectangle {
width,

View file

@ -149,8 +149,8 @@ where
background: Background::Color(
style_sheet.value_color(),
),
border_radius: 0,
border_width: 0,
border_radius: 0.0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
offset,
@ -193,8 +193,8 @@ where
background: Background::Color(
style_sheet.selection_color(),
),
border_radius: 0,
border_width: 0,
border_radius: 0.0,
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
if end == right {