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

[emath] Use const values for Vec2::ZERO, Rect::EVERYTHING etc

This commit is contained in:
Emil Ernerfeldt
2021-02-05 09:49:21 +01:00
parent 10e86b055d
commit 2d9d06dbff
20 changed files with 118 additions and 71 deletions

View File

@@ -82,8 +82,11 @@ impl Pos2 {
/// The zero position, the origin.
/// The top left corner in a GUI.
/// Same as `Pos2::default()`.
pub const ZERO: Self = Self { x: 0.0, y: 0.0 };
#[deprecated = "Use Pos2::ZERO instead"]
pub const fn zero() -> Self {
Self { x: 0.0, y: 0.0 }
Self::ZERO
}
pub const fn new(x: f32, y: f32) -> Self {