react-archer
Version:
Draw arrows between DOM elements in React
22 lines (16 loc) • 326 B
JavaScript
// @flow
class Point {
x: number;
y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
add(point: Point) {
return new Point(this.x + point.x, this.y + point.y);
}
substract(point: Point) {
return new Point(this.x - point.x, this.y - point.y);
}
}
export default Point;