This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
crock/clock-tui/src/clock_text/point.rs
Jimmy 25d6795d7e
extract a font layer and reimplement the bricks font (#23)
* implement the font layer

* run fmt

* refactor
2022-09-05 21:01:43 +08:00

20 lines
410 B
Rust

use std::ops;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Point(pub u16, pub u16);
impl ops::Add<&Point> for Point {
type Output = Point;
fn add(self, other: &Point) -> Point {
Point(self.0 + other.0, self.1 + other.1)
}
}
impl ops::Mul<u16> for Point {
type Output = Point;
fn mul(self, other: u16) -> Point {
Point(self.0 * other, self.1 * other)
}
}