1 | define(["require", "exports"], function (require, exports) {
|
2 | "use strict";
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | var Rectangle = (function () {
|
11 | function Rectangle(left, right, top, bottom) {
|
12 | if (left === void 0) { left = 0; }
|
13 | if (right === void 0) { right = 0; }
|
14 | if (top === void 0) { top = 0; }
|
15 | if (bottom === void 0) { bottom = 0; }
|
16 | this.top = top;
|
17 | this.bottom = bottom;
|
18 | this.left = left;
|
19 | this.right = right;
|
20 | }
|
21 | Object.defineProperty(Rectangle.prototype, "width", {
|
22 | |
23 |
|
24 |
|
25 | get: function () {
|
26 | return this.right - this.left;
|
27 | },
|
28 | enumerable: true,
|
29 | configurable: true
|
30 | });
|
31 | Object.defineProperty(Rectangle.prototype, "height", {
|
32 | |
33 |
|
34 |
|
35 | get: function () {
|
36 | return this.bottom - this.top;
|
37 | },
|
38 | enumerable: true,
|
39 | configurable: true
|
40 | });
|
41 | |
42 |
|
43 |
|
44 | Rectangle.prototype.equals = function (rect) {
|
45 |
|
46 |
|
47 | return (parseFloat(this.top.toFixed(4)) === parseFloat(rect.top.toFixed(4)) &&
|
48 | parseFloat(this.bottom.toFixed(4)) === parseFloat(rect.bottom.toFixed(4)) &&
|
49 | parseFloat(this.left.toFixed(4)) === parseFloat(rect.left.toFixed(4)) &&
|
50 | parseFloat(this.right.toFixed(4)) === parseFloat(rect.right.toFixed(4)));
|
51 | };
|
52 | return Rectangle;
|
53 | }());
|
54 | exports.Rectangle = Rectangle;
|
55 | });
|
56 |
|
\ | No newline at end of file |