1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 21:00:03 -04:00

Mobile fixes

This commit is contained in:
Emil Ernerfeldt
2019-01-17 17:34:01 -06:00
parent 46293f6fd4
commit 391abda3d5
7 changed files with 112 additions and 227 deletions

View File

@@ -154,4 +154,14 @@ pub fn remap_clamp(from: f32, from_min: f32, from_max: f32, to_min: f32, to_max:
lerp(to_min, to_max, t)
}
pub fn clamp(x: f32, min: f32, max: f32) -> f32 {
if x <= min {
min
} else if x >= max {
max
} else {
x
}
}
pub const TAU: f32 = 2.0 * std::f32::consts::PI;