rust/integral-geometry/src/lib.rs
changeset 14126 32383b888309
parent 14125 376a0551b00a
child 14131 c416d32764b7
equal deleted inserted replaced
14125:376a0551b00a 14126:32383b888309
    63     pub fn cross(self, other: Point) -> i32 {
    63     pub fn cross(self, other: Point) -> i32 {
    64         self.dot(other.rotate90())
    64         self.dot(other.rotate90())
    65     }
    65     }
    66 
    66 
    67     #[inline]
    67     #[inline]
    68     pub fn fit(&self, rect: &Rect) -> Point {
    68     pub fn fit(self, rect: &Rect) -> Point {
    69         let x = if self.x > rect.right() {
    69         let x = if self.x > rect.right() {
    70             rect.right()
    70             rect.right()
    71         } else if self.x < rect.left() {
    71         } else if self.x < rect.left() {
    72             rect.left()
    72             rect.left()
    73         } else {
    73         } else {