
* Remove cfg!(feature = "metal-auto-capture") This cfg! has existed since the initial commit, but the corresponding feature has never been part of Cargo.toml * Remove unnecessary handle_create_window_events call * Remove EventLoopProxyPtr wrapper * Remove unnecessary statics * Fix unrelated deprecation warning to fix CI
25 lines
546 B
Rust
25 lines
546 B
Rust
use bevy_core::Byteable;
|
|
use bevy_math::Vec2;
|
|
|
|
/// A rectangle defined by two points. There is no defined origin, so 0,0 could be anywhere (top-left, bottom-left, etc)
|
|
#[repr(C)]
|
|
#[derive(Default, Clone, Copy, Debug)]
|
|
pub struct Rect {
|
|
/// The beginning point of the rect
|
|
pub min: Vec2,
|
|
/// The ending point of the rect
|
|
pub max: Vec2,
|
|
}
|
|
|
|
impl Rect {
|
|
pub fn width(&self) -> f32 {
|
|
self.max.x - self.min.x
|
|
}
|
|
|
|
pub fn height(&self) -> f32 {
|
|
self.max.y - self.min.y
|
|
}
|
|
}
|
|
|
|
unsafe impl Byteable for Rect {}
|