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

Remove everything marked deprecated

This commit is contained in:
Emil Ernerfeldt
2021-08-28 11:46:30 +02:00
parent 0db74f3000
commit 1fbce6b2c3
24 changed files with 1 additions and 456 deletions

View File

@@ -27,23 +27,6 @@ impl Align {
/// Convenience for [`Self::Max`]
pub const BOTTOM: Self = Self::Max;
#[deprecated = "Use Self::LEFT"]
pub fn left() -> Self {
Self::LEFT
}
#[deprecated = "Use Self::RIGHT"]
pub fn right() -> Self {
Self::RIGHT
}
#[deprecated = "Use Self::TOP"]
pub fn top() -> Self {
Self::TOP
}
#[deprecated = "Use Self::BOTTOM"]
pub fn bottom() -> Self {
Self::BOTTOM
}
/// Convert `Min => 0.0`, `Center => 0.5` or `Max => 1.0`.
#[inline(always)]
pub fn to_factor(self) -> f32 {

View File

@@ -192,24 +192,6 @@ where
}
}
/// Returns `range.start()` if `x <= range.start()`,
/// returns `range.end()` if `x >= range.end()`
/// and returns `x` elsewhen.
#[deprecated = "Use f32::clamp instead"]
pub fn clamp<T>(x: T, range: RangeInclusive<T>) -> T
where
T: Copy + PartialOrd,
{
crate::emath_assert!(range.start() <= range.end());
if x <= *range.start() {
*range.start()
} else if *range.end() <= x {
*range.end()
} else {
x
}
}
/// Round a value to the given number of decimal places.
pub fn round_to_decimals(value: f64, decimal_places: usize) -> f64 {
// This is a stupid way of doing this, but stupid works.

View File

@@ -109,11 +109,6 @@ impl Pos2 {
/// 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::ZERO
}
pub const fn new(x: f32, y: f32) -> Self {
Self { x, y }
}

View File

@@ -51,29 +51,6 @@ impl Rect {
max: pos2(-f32::NAN, -f32::NAN),
};
#[deprecated = "Use Rect::EVERYTHING"]
pub fn everything() -> Self {
let inf = f32::INFINITY;
Self {
min: pos2(-inf, -inf),
max: pos2(inf, inf),
}
}
#[deprecated = "Use Rect::NOTHING"]
pub fn nothing() -> Self {
let inf = f32::INFINITY;
Self {
min: pos2(inf, inf),
max: pos2(-inf, -inf),
}
}
#[deprecated = "Use Rect::NAN"]
pub fn invalid() -> Self {
Self::NAN
}
#[inline(always)]
pub const fn from_min_max(min: Pos2, max: Pos2) -> Self {
Rect { min, max }
@@ -297,22 +274,12 @@ impl Rect {
self.max.y..=self.min.y
}
#[deprecated = "Use is_negative instead"]
pub fn is_empty(&self) -> bool {
self.max.x < self.min.x || self.max.y < self.min.y
}
/// `width < 0 || height < 0`
#[inline(always)]
pub fn is_negative(&self) -> bool {
self.max.x < self.min.x || self.max.y < self.min.y
}
#[deprecated = "Use !is_negative() instead"]
pub fn is_non_negative(&self) -> bool {
!self.is_negative()
}
/// `width > 0 && height > 0`
#[inline(always)]
pub fn is_positive(&self) -> bool {

View File

@@ -33,11 +33,6 @@ impl Rot2 {
/// The identity rotation: nothing rotates
pub const IDENTITY: Self = Self { s: 0.0, c: 1.0 };
#[deprecated = "Use Rot2::IDENTITY"]
pub fn identity() -> Self {
Self::IDENTITY
}
/// A 𝞃/4 = 90° rotation means rotating the X axis to the Y axis.
pub fn from_angle(angle: f32) -> Self {
let (s, c) = angle.sin_cos();

View File

@@ -112,16 +112,6 @@ impl Vec2 {
pub const ZERO: Self = Self { x: 0.0, y: 0.0 };
pub const INFINITY: Self = Self::splat(f32::INFINITY);
#[deprecated = "Use Vec2::ZERO instead"]
pub fn zero() -> Self {
Self::ZERO
}
#[deprecated = "Use Vec2::INFINITY instead"]
pub fn infinity() -> Self {
Self::INFINITY
}
#[inline(always)]
pub const fn new(x: f32, y: f32) -> Self {
Self { x, y }