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