mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Replace emath::clamp with f32::clamp (new in rustc 1.50)
This commit is contained in:
@@ -204,11 +204,10 @@ impl Rect {
|
||||
}
|
||||
|
||||
/// Return the given points clamped to be inside the rectangle
|
||||
/// Panics if [`Self::is_negative`].
|
||||
#[must_use]
|
||||
pub fn clamp(&self, mut p: Pos2) -> Pos2 {
|
||||
p.x = clamp(p.x, self.x_range());
|
||||
p.y = clamp(p.y, self.y_range());
|
||||
p
|
||||
pub fn clamp(&self, p: Pos2) -> Pos2 {
|
||||
p.clamp(self.min, self.max)
|
||||
}
|
||||
|
||||
pub fn extend_with(&mut self, p: Pos2) {
|
||||
|
||||
Reference in New Issue
Block a user