diff options
author | bob <bcz@cs.brown.edu> | 2019-03-25 16:00:59 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-03-25 16:00:59 -0400 |
commit | 60ff3da65fbabd21c29bf1eecace02ebc1f6430c (patch) | |
tree | ef7650444650bc32272252d4dfcd0c0c3f212715 /src/client/northstar/utils/MathUtil.ts | |
parent | 1238c172a2ac9fb7dfdee2588f141f2ae0c22b8e (diff) |
histograms render
Diffstat (limited to 'src/client/northstar/utils/MathUtil.ts')
-rw-r--r-- | src/client/northstar/utils/MathUtil.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/northstar/utils/MathUtil.ts b/src/client/northstar/utils/MathUtil.ts index 3ed8628ee..bb7e73871 100644 --- a/src/client/northstar/utils/MathUtil.ts +++ b/src/client/northstar/utils/MathUtil.ts @@ -1,13 +1,17 @@ export class PIXIPoint { - public x: number; - public y: number; + public get x() { return this.coords[0]; } + public get y() { return this.coords[1]; } + public set x(value: number) { this.coords[0] = value; } + public set y(value: number) { this.coords[1] = value; } + public coords: number[] = [0, 0]; constructor(x: number, y: number) { - this.x = x; - this.y = y; + this.coords[0] = x; + this.coords[1] = y; } } + export class PIXIRectangle { public x: number; public y: number; @@ -17,6 +21,7 @@ export class PIXIRectangle { public get right() { return this.x + this.width; } public get top() { return this.y } public get bottom() { return this.top + this.height } + public static get EMPTY() { return new PIXIRectangle(0, 0, -1, -1); } constructor(x: number, y: number, width: number, height: number) { this.x = x; this.y = y; |