igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
47 lines (46 loc) • 1.92 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { Base, markType } from "igniteui-angular-core";
import { IDetectsCollisions_$type } from "./IDetectsCollisions";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
/**
* @hidden
*/
var CollisionAvoider = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CollisionAvoider, _super);
function CollisionAvoider() {
var _this = _super.call(this) || this;
_this.a = new List$1(Rect.$, 0);
return _this;
}
CollisionAvoider.prototype.tryAdd = function (a) {
for (var b = this.a.count - 1; b >= 0; --b) {
if (a.left > this.a._inner[b].right) {
break;
}
if (this.a._inner[b].intersectsWith(a)) {
return false;
}
}
if (this.a.count == 0 || a.right >= this.a._inner[this.a.count - 1].right) {
this.a.add(a);
}
else {
this.a.add(a);
this.a.aa(function (c, d) { return Math.sign(c.right - d.right); });
}
return true;
};
CollisionAvoider.prototype.clear = function () {
this.a.clear();
};
CollisionAvoider.$t = markType(CollisionAvoider, 'CollisionAvoider', Base.$, [IDetectsCollisions_$type]);
return CollisionAvoider;
}(Base));
export { CollisionAvoider };