bg2e-js 2.3.9 → 2.3.11

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.
package/dist/bg2e-js.js CHANGED
@@ -8731,7 +8731,7 @@ class w0 extends ce {
8731
8731
  }
8732
8732
  class v0 {
8733
8733
  constructor(e) {
8734
- this._selectionBuffer = null, this._selectionIdVisitor = null, this._downPosition = new h(), this._viewportSize = [1, 1], this._renderer = e, this._sceneRoot = null, this._camera = null, this._selectionMode = mt.POLY_LIST, this._multiSelect = !1, this._selection = [], this._selectionChangedCallbacks = {};
8734
+ this._selectionBuffer = null, this._selectionIdVisitor = null, this._downPosition = new h(), this._viewportSize = [1, 1], this._enabled = !0, this._renderer = e, this._sceneRoot = null, this._camera = null, this._selectionMode = mt.POLY_LIST, this._multiSelect = !1, this._selection = [], this._selectionChangedCallbacks = {};
8735
8735
  }
8736
8736
  async init() {
8737
8737
  this._selectionBuffer = new d0(this._renderer), await this._selectionBuffer.init(), this._selectionIdVisitor = new w0();
@@ -8742,6 +8742,18 @@ class v0 {
8742
8742
  get selection() {
8743
8743
  return this._selection;
8744
8744
  }
8745
+ enable() {
8746
+ this.enabled = !0;
8747
+ }
8748
+ disable() {
8749
+ this.enabled = !1;
8750
+ }
8751
+ get enabled() {
8752
+ return this._enabled;
8753
+ }
8754
+ set enabled(e) {
8755
+ this._enabled = e, this._enabled || this.clearSelection();
8756
+ }
8745
8757
  clearSelection() {
8746
8758
  this._selection.forEach((e) => e.polyList.selected = !1), this._selection = [], this.triggerSelectionChanged();
8747
8759
  }
@@ -8777,7 +8789,7 @@ class v0 {
8777
8789
  this._selectionChangedCallbacks[e](this._selection);
8778
8790
  }
8779
8791
  mouseUp(e) {
8780
- if (!this._selectionBuffer || !this._selectionIdVisitor || !this.camera || !this.sceneRoot)
8792
+ if (!this._selectionBuffer || !this._selectionIdVisitor || !this.camera || !this.sceneRoot || !this.enabled)
8781
8793
  return;
8782
8794
  const r = new h([e.x, e.y]);
8783
8795
  if (h.Distance(this._downPosition, r) < 2) {