UNPKG

igniteui-react-core

Version:
145 lines (144 loc) 4.41 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 { __extends } from "tslib"; import { Base, runOn, markType } from "./type"; import { List$1 } from "./List$1"; import { ISchedulableRender_$type } from "./ISchedulableRender"; /** * @hidden */ var CanvasRenderScheduler = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CanvasRenderScheduler, _super); function CanvasRenderScheduler() { var _this = _super.call(this) || this; _this.d = true; _this.i = null; _this.h = null; _this.a = null; _this.c = false; _this.k = -1; _this.j = null; _this.b = false; _this.e = false; _this.i = new List$1(ISchedulableRender_$type, 0); _this.h = new List$1(CanvasRenderScheduler.$, 0); return _this; } CanvasRenderScheduler.prototype.o = function (a) { this.d = true; this.i.add(a); }; CanvasRenderScheduler.prototype.u = function (a) { this.d = true; this.i.remove(a); }; CanvasRenderScheduler.prototype.s = function () { this.d = true; this.q(); }; Object.defineProperty(CanvasRenderScheduler.prototype, "g", { get: function () { return this.c; }, enumerable: false, configurable: true }); CanvasRenderScheduler.prototype.m = function (a) { var b = this.j; this.j = a; if (this.c && this.j != null && b == null) { this.j.setTimeout(runOn(this, this.n), 0); } }; CanvasRenderScheduler.prototype.q = function () { if (!this.c) { this.c = true; if (this.j != null) { this.j.setTimeout(runOn(this, this.n), 0); } else { window.setTimeout(runOn(this, this.n), 0); } } }; CanvasRenderScheduler.prototype.r = function (a, b) { this.q(); }; CanvasRenderScheduler.prototype.l = function () { if (this.k != -1) { window.clearTimeout(this.k); this.k = -1; } if (this.c) { this.n(); } }; CanvasRenderScheduler.prototype.n = function () { this.k = -1; if (this.c) { this.c = false; this.b = true; if (this.h.count > 0) { for (var a = 0; a < this.h.count; a++) { this.h._inner[a].l(); } } if (this.d) { this.t(); } this.p(); } }; Object.defineProperty(CanvasRenderScheduler.prototype, "f", { get: function () { return this.b; }, enumerable: false, configurable: true }); CanvasRenderScheduler.prototype.p = function () { if (this.e) { this.b = false; return; } var a = true; for (var b = 0; b < this.i.count; b++) { var c = this.i._inner[b]; c.preRender(); } for (var d = 0; d < this.i.count; d++) { var e = this.i._inner[d]; e.undirty(a); a = false; } for (var f = 0; f < this.i.count; f++) { var g = this.i._inner[f]; g.postRender(); } this.b = false; if (this.a != null) { this.a(); } }; CanvasRenderScheduler.prototype.t = function () { this.i.aa(function (a, b) { var c = a; var d = b; if (c.index < d.index) { return -1; } if (c.index > d.index) { return 1; } return 0; }); this.d = false; }; CanvasRenderScheduler.$t = markType(CanvasRenderScheduler, 'CanvasRenderScheduler'); return CanvasRenderScheduler; }(Base)); export { CanvasRenderScheduler };