1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use {Mm, Pt};
#[derive(Debug, Copy, Clone)]
pub struct Point {
pub x: Pt,
pub y: Pt,
}
impl Point {
#[inline]
pub fn new(x: Mm, y: Mm)
-> Self
{
Self {
x: x.into(),
y: y.into(),
}
}
}
impl PartialEq for Point {
fn eq(&self, other: &Point) -> bool {
if self.x.0.is_normal() && other.x.0.is_normal() &&
self.y.0.is_normal() && other.y.0.is_normal() {
let x_eq = self.x == other.x;
if !x_eq { return false; }
let y_eq = self.y == other.y;
if y_eq { return true; }
}
false
}
}