mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
@@ -5,6 +5,7 @@ use sys::rect as ll;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::ops::{Deref, Add, BitAnd, BitOr, Div, Mul, Neg, Sub};
|
||||
use std::convert::{AsRef, AsMut};
|
||||
|
||||
/// The maximal integer value that can be used for rectangles.
|
||||
///
|
||||
@@ -450,6 +451,18 @@ impl From<(i32, i32, u32, u32)> for Rect {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<ll::SDL_Rect> for Rect {
|
||||
fn as_ref(&self) -> &ll::SDL_Rect {
|
||||
&self.raw
|
||||
}
|
||||
}
|
||||
|
||||
impl AsMut<ll::SDL_Rect> for Rect {
|
||||
fn as_mut(&mut self) -> &mut ll::SDL_Rect {
|
||||
&mut self.raw
|
||||
}
|
||||
}
|
||||
|
||||
// Intersection
|
||||
impl BitAnd<Rect> for Rect {
|
||||
type Output = Option<Rect>;
|
||||
|
||||
Reference in New Issue
Block a user