pub struct HitRegion {
pub id: String,
pub rect: Rect,
pub z_index: i16,
pub disabled: bool,
pub cursor: CursorKind,
}Expand description
Hit-testable rectangular region. Constructors and HitMap::push sanitize identifiers.
Fields§
§id: String§rect: Rect§z_index: i16§disabled: bool§cursor: CursorKindImplementations§
Source§impl HitRegion
impl HitRegion
pub fn new(id: impl Into<String>, rect: Rect) -> Self
pub fn with_z_index(self, z_index: i16) -> Self
pub fn with_cursor(self, cursor: CursorKind) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn sanitized_id(&self) -> String
pub fn contains(&self, point: Vec2) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HitRegion
impl<'de> Deserialize<'de> for HitRegion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for HitRegion
Auto Trait Implementations§
impl Freeze for HitRegion
impl RefUnwindSafe for HitRegion
impl Send for HitRegion
impl Sync for HitRegion
impl Unpin for HitRegion
impl UnsafeUnpin for HitRegion
impl UnwindSafe for HitRegion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more