Struct cognitive_qualia::defs::Area
[−]
[src]
#[repr(C)]pub struct Area { pub pos: Position, pub size: Size, }
Type defining 2D area.
Fields
pos: Position
size: Size
Methods
impl Area
[src]
fn new(pos: Position, size: Size) -> Self
Constructs Area
from Position
and Size
.
fn create(x: isize, y: isize, width: usize, height: usize) -> Self
Constructs Area
from coordinates and dimensions.
fn rebased(&self) -> Self
Return this area but with position set to origin (0,0).
fn is_zero(&self) -> bool
Check if Area
has zero area.
fn contains(&self, pos: &Position) -> bool
Check if Area
contains given position.
fn calculate_center(&self) -> Position
Calculate position in center of the area.
fn inflate(&mut self, area: &Area)
Inflates this Area
so that it contains passed area
.
Trait Implementations
impl Clone for Area
[src]
fn clone(&self) -> Area
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Area
[src]
impl Debug for Area
[src]
impl PartialEq for Area
[src]
fn eq(&self, __arg_0: &Area) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Area) -> bool
This method tests for !=
.