Cleanup of UV space handling

This commit is contained in:
meehl committed 2026-08-25 10:46:12 +02:00
1 parent 8d17f8e64f
commit 7b925876a5
9 files changed
+73 -118

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
use crate::math::{Point, Quad, Rect, Size};
pub struct UvSpace;
pub type UvPoint = Point<f32, UvSpace>;
pub type UvRect = Rect<f32, UvSpace>;
pub type UvQuad = Quad<f32, UvSpace>;
pub trait UvConstructors {
fn full_uv() -> Self;
fn white_uv() -> Self;
}
impl UvConstructors for UvRect {
#[inline]
fn full_uv() -> Self {
Self::from_size(Size::new(1.0, 1.0))
}
#[inline]
fn white_uv() -> Self {
Self::zero()
}
}
impl UvConstructors for UvQuad {
#[inline]
fn full_uv() -> Self {
Self::from_size(Size::new(1.0, 1.0))
}
#[inline]
fn white_uv() -> Self {
Self::zero()
}
}