std::f32::INFINITY -> f32::INFINITY

This commit is contained in:
Emil Ernerfeldt 2020-04-25 10:52:20 +02:00
parent 299cc76fcf
commit 02f3b6dddf
6 changed files with 10 additions and 10 deletions

View file

@ -190,7 +190,7 @@ impl Context {
let layer = Layer::Popup; // TODO: Layer::Error
let text_style = TextStyle::Monospace;
let font = &self.fonts[text_style];
let (text, size) = font.layout_multiline(text, std::f32::INFINITY);
let (text, size) = font.layout_multiline(text, f32::INFINITY);
let rect = align_rect(Rect::from_min_size(pos, size), align);
self.add_paint_cmd(
layer,
@ -216,7 +216,7 @@ impl Context {
text_color: Option<Color>,
) -> Vec2 {
let font = &self.fonts[text_style];
let (text, size) = font.layout_multiline(text, std::f32::INFINITY);
let (text, size) = font.layout_multiline(text, f32::INFINITY);
let rect = align_rect(Rect::from_min_size(pos, size), align);
self.add_text(layer, rect.min(), text_style, text, text_color);
size

View file

@ -193,9 +193,9 @@ impl Painting {
self.current_line.clear();
}
region.add_custom_contents(vec2(std::f32::INFINITY, 200.0), |region| {
region.add_custom_contents(vec2(f32::INFINITY, 200.0), |region| {
let interact = region.reserve_space(region.available_space(), Some(region.id));
region.clip_rect = interact.rect; // Make sure we don't paint out of bounds
region.clip_rect = region.clip_rect.intersect(interact.rect); // Make sure we don't paint out of bounds
if interact.active {
if let Some(mouse_pos) = region.input().mouse_pos {

View file

@ -101,7 +101,7 @@ pub fn show_popup(ctx: &Arc<Context>, window_pos: Pos2, add_contents: impl FnOnc
let style = ctx.style();
let window_padding = style.window_padding;
let size = vec2(ctx.input.screen_size.x.min(350.0), std::f32::INFINITY); // TODO: popup/tooltip width
let size = vec2(ctx.input.screen_size.x.min(350.0), f32::INFINITY); // TODO: popup/tooltip width
let inner_rect = Rect::from_min_size(window_pos + window_padding, size);
let mut contents_region = Region::new(ctx.clone(), layer, Id::popup(), inner_rect);

View file

@ -291,7 +291,7 @@ pub struct Rect {
impl Rect {
/// Infinite rectangle that contains everything
pub fn everything() -> Self {
let inf = std::f32::INFINITY;
let inf = f32::INFINITY;
Self {
min: pos2(-inf, -inf),
max: pos2(inf, inf),
@ -299,7 +299,7 @@ impl Rect {
}
pub fn nothing() -> Self {
let inf = std::f32::INFINITY;
let inf = f32::INFINITY;
Self {
min: pos2(inf, inf),
max: pos2(-inf, -inf),

View file

@ -407,7 +407,7 @@ impl Region {
text_color: Option<Color>,
) -> Vec2 {
let font = &self.fonts()[text_style];
let (text, size) = font.layout_multiline(text, std::f32::INFINITY);
let (text, size) = font.layout_multiline(text, f32::INFINITY);
let rect = align_rect(Rect::from_min_size(pos, size), align);
self.add_text(rect.min(), text_style, text, text_color);
size

View file

@ -323,8 +323,8 @@ impl<'a> Slider<'a> {
fn from_get_set(get_set_value: impl 'a + FnMut(Option<f32>) -> f32) -> Self {
Slider {
get_set_value: Box::new(get_set_value),
min: std::f32::NAN,
max: std::f32::NAN,
min: f32::NAN,
max: f32::NAN,
text: None,
precision: 3,
text_on_top: None,