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

Drag to re-arrange tabs

This commit is contained in:
Emil Ernerfeldt
2023-04-24 20:46:21 +02:00
parent 13ec65cf08
commit 240989df8b
2 changed files with 80 additions and 34 deletions

View File

@@ -188,6 +188,14 @@ impl Pos2 {
y: self.y.clamp(min.y, max.y),
}
}
/// Linearly interpolate towards another point, so that `0.0 => self, 1.0 => other`.
pub fn lerp(&self, other: Pos2, t: f32) -> Pos2 {
Pos2 {
x: lerp(self.x..=other.x, t),
y: lerp(self.y..=other.y, t),
}
}
}
impl std::ops::Index<usize> for Pos2 {