UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

45 lines (44 loc) 1.77 kB
/* 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 { 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 */ export let CollisionAvoider = /*@__PURE__*/ (() => { class CollisionAvoider extends Base { constructor() { super(); this.a = new List$1(Rect.$, 0); } tryAdd(a) { for (let 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((c, d) => Math.sign(c.right - d.right)); } return true; } clear() { this.a.clear(); } } CollisionAvoider.$t = markType(CollisionAvoider, 'CollisionAvoider', Base.$, [IDetectsCollisions_$type]); return CollisionAvoider; })();