UNPKG

igniteui-react-core

Version:
67 lines (66 loc) 2.35 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 "./type"; import { Rect } from "./Rect"; /** * @hidden */ export let QuadTreeBoundingBox = /*@__PURE__*/ (() => { class QuadTreeBoundingBox extends Base { constructor() { super(); this.d = 0; this.e = 0; this.g = 0; this.f = 0; this.i = null; } c(a) { if (this.d + this.g < a.d - a.g || this.e + this.f < a.e - a.f || this.d - this.g > a.d + a.g || this.e - this.f > a.e + a.f) { return false; } return true; } h(a) { let b = this.d - this.g; let c = this.e - this.f; let d = this.d + this.g; let e = this.e + this.f; let f = a.d - a.g; let g = a.e - a.f; let h = a.d + a.g; let i = a.e + a.f; let j = Math.max(b, f); let k = Math.min(d, h); let l = Math.max(c, g); let m = Math.min(e, i); return (k - j) * (m - l); } static b(a) { let b = new QuadTreeBoundingBox(); b.d = a.left + a.width / 2; b.e = a.top + a.height / 2; b.f = a.height / 2; b.g = a.width / 2; return b; } static a(a) { let b = new QuadTreeBoundingBox(); b.d = a.left + a.width / 2; b.e = a.top + a.height / 2; b.f = a.height / 2; b.g = a.width / 2; return b; } j() { let a = new Rect(0, this.d - this.g, this.e - this.f, this.g + this.g, this.f + this.f); return a; } } QuadTreeBoundingBox.$t = /*@__PURE__*/ markType(QuadTreeBoundingBox, 'QuadTreeBoundingBox'); return QuadTreeBoundingBox; })();