bruce-models 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3357,6 +3357,7 @@
3357
3357
  this.batchSize = batchSize;
3358
3358
  this.viewPort = viewPort;
3359
3359
  this.attrFilter = attrFilter;
3360
+ this.updateBounds();
3360
3361
  }
3361
3362
  Object.defineProperty(Getter.prototype, "OnUpdate", {
3362
3363
  get: function () {
@@ -3609,7 +3610,6 @@
3609
3610
  (function (BatchedDataGetter) {
3610
3611
  var Getter = /** @class */ (function () {
3611
3612
  function Getter(data, viewPort, batchSize) {
3612
- var _this = this;
3613
3613
  this.viewPortRemoval = null;
3614
3614
  this.viewRect = null;
3615
3615
  this.viewCenter = null;
@@ -3617,10 +3617,6 @@
3617
3617
  this.data = data;
3618
3618
  this.viewPort = viewPort;
3619
3619
  this.batchSize = batchSize;
3620
- this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3621
- _this.updateBounds();
3622
- _this.startGetterLoop();
3623
- });
3624
3620
  }
3625
3621
  Object.defineProperty(Getter.prototype, "OnUpdate", {
3626
3622
  get: function () {
@@ -3632,10 +3628,21 @@
3632
3628
  enumerable: false,
3633
3629
  configurable: true
3634
3630
  });
3631
+ Getter.prototype.Start = function () {
3632
+ var _this = this;
3633
+ this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3634
+ _this.updateViewport();
3635
+ });
3636
+ this.updateViewport();
3637
+ };
3635
3638
  Getter.prototype.Dispose = function () {
3636
3639
  var _a;
3637
3640
  (_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
3638
3641
  };
3642
+ Getter.prototype.updateViewport = function () {
3643
+ this.updateBounds();
3644
+ this.startGetterLoop();
3645
+ };
3639
3646
  Getter.prototype.updateBounds = function () {
3640
3647
  var viewRect = this.viewPort.GetBounds();
3641
3648
  var poi = this.viewPort.GetTarget();
@@ -3657,13 +3664,18 @@
3657
3664
  return;
3658
3665
  }
3659
3666
  var index = 0;
3660
- this.getterInterval = setInterval(function () {
3667
+ var onTick = function () {
3661
3668
  _this.processBatch(_this.data.slice(index, index + _this.batchSize));
3662
3669
  index += _this.batchSize;
3663
- if (index >= _this.data.length) {
3664
- clearInterval(_this.getterInterval);
3665
- }
3666
- }, GETTER_DELAY);
3670
+ return index >= _this.data.length;
3671
+ };
3672
+ if (!onTick()) {
3673
+ this.getterInterval = setInterval(function () {
3674
+ if (onTick()) {
3675
+ clearInterval(_this.getterInterval);
3676
+ }
3677
+ }, GETTER_DELAY);
3678
+ }
3667
3679
  };
3668
3680
  Getter.prototype.processBatch = function (batch) {
3669
3681
  var _a;