rust/integral-geometry/src/lib.rs
changeset 14054 3185fb34f3b5
parent 14052 9c817b2eedae
child 14059 c6745a1c827a
equal deleted inserted replaced
14053:38eb5937169e 14054:3185fb34f3b5
   164 
   164 
   165 impl Rect {
   165 impl Rect {
   166     #[inline]
   166     #[inline]
   167     pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self {
   167     pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self {
   168         Self { x, y, width, height }
   168         Self { x, y, width, height }
       
   169     }
       
   170 
       
   171     #[inline]
       
   172     pub fn size(&self) -> Size {
       
   173         Size::new(self.width as usize, self.height as usize)
       
   174     }
       
   175 
       
   176     #[inline]
       
   177     pub fn area(&self) -> usize {
       
   178         self.size().area()
   169     }
   179     }
   170 }
   180 }
   171 
   181 
   172 
   182 
   173 pub struct LinePoints {
   183 pub struct LinePoints {