blob: e6c28ef4bfc228c4753e85aa310104d941ccd2c1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use crate::*;
pub struct VectorPoints {
points: [ScreenPosition; 2],
pointer: usize,
}
impl VectorPoints {
pub fn new() -> Self {
Self { points: [ScreenPosition::ZERO; 2], pointer: 0 }
}
pub fn push(&mut self, point: ScreenPosition) {
self.points[self.pointer] = point;
self.pointer = (self.pointer + 1) % 2;
}
pub fn get_pair(&self) -> [ScreenPosition; 2] {
self.points
}
}
|