mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Replace emath::clamp with f32::clamp (new in rustc 1.50)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use {
|
||||
egui::{
|
||||
emath::{clamp, Rect},
|
||||
emath::Rect,
|
||||
epaint::{Color32, Mesh},
|
||||
},
|
||||
glium::{
|
||||
@@ -201,10 +201,10 @@ impl Painter {
|
||||
let clip_max_y = pixels_per_point * clip_rect.max.y;
|
||||
|
||||
// Make sure clip rect can fit within a `u32`:
|
||||
let clip_min_x = clamp(clip_min_x, 0.0..=width_in_pixels as f32);
|
||||
let clip_min_y = clamp(clip_min_y, 0.0..=height_in_pixels as f32);
|
||||
let clip_max_x = clamp(clip_max_x, clip_min_x..=width_in_pixels as f32);
|
||||
let clip_max_y = clamp(clip_max_y, clip_min_y..=height_in_pixels as f32);
|
||||
let clip_min_x = clip_min_x.clamp(0.0, width_in_pixels as f32);
|
||||
let clip_min_y = clip_min_y.clamp(0.0, height_in_pixels as f32);
|
||||
let clip_max_x = clip_max_x.clamp(clip_min_x, width_in_pixels as f32);
|
||||
let clip_max_y = clip_max_y.clamp(clip_min_y, height_in_pixels as f32);
|
||||
|
||||
let clip_min_x = clip_min_x.round() as u32;
|
||||
let clip_min_y = clip_min_y.round() as u32;
|
||||
|
||||
Reference in New Issue
Block a user