fabric-vectr 6.7.4 → 6.7.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.
package/dist/index.js CHANGED
@@ -366,7 +366,7 @@
366
366
  }
367
367
  const cache = new Cache();
368
368
 
369
- var version = "6.7.4";
369
+ var version = "6.7.6";
370
370
 
371
371
  // use this syntax so babel plugin see this import here
372
372
  const VERSION = version;
@@ -13730,11 +13730,11 @@
13730
13730
  */
13731
13731
  _defineProperty(this, "isolatedObject", void 0);
13732
13732
  /**
13733
- * Specified search objects
13733
+ * Fixed search objects
13734
13734
  * @type Boolean
13735
13735
  * @default null
13736
13736
  */
13737
- _defineProperty(this, "_searchTargets", void 0);
13737
+ _defineProperty(this, "_fixedSearchTargets", void 0);
13738
13738
  /**
13739
13739
  * Keep track of the subTargets for Mouse Events, ordered bottom up from innermost nested subTarget
13740
13740
  * @type FabricObject[]
@@ -14177,8 +14177,8 @@
14177
14177
  * Manually set the search object
14178
14178
  * @param objects
14179
14179
  */
14180
- setSearchTargets(objects) {
14181
- this._searchTargets = objects;
14180
+ setFixedSearchTargets(objects) {
14181
+ this._fixedSearchTargets = objects;
14182
14182
  }
14183
14183
 
14184
14184
  /**
@@ -14186,7 +14186,7 @@
14186
14186
  * @returns
14187
14187
  */
14188
14188
  getSearchTargets() {
14189
- return this._searchTargets || (this.isolatedObject ? this.isolatedObject._objects : this._objects);
14189
+ return this._fixedSearchTargets || (this.isolatedObject ? this.isolatedObject._objects : this._objects);
14190
14190
  }
14191
14191
 
14192
14192
  /**
@@ -14204,7 +14204,7 @@
14204
14204
  activeObject = this._activeObject,
14205
14205
  aObjects = this.getActiveObjects();
14206
14206
  this.targets = [];
14207
- if (activeObject && aObjects.length >= 1) {
14207
+ if (activeObject && aObjects.length >= 1 && !this._fixedSearchTargets) {
14208
14208
  if (activeObject.findControl(pointer, isTouchEvent(e))) {
14209
14209
  // if we hit the corner of the active object, let's return that.
14210
14210
  return activeObject;
@@ -15165,7 +15165,7 @@
15165
15165
  */
15166
15166
  findDragTargets(e) {
15167
15167
  this.targets = [];
15168
- const target = this._searchPossibleTargets(this._objects, this.getViewportPoint(e));
15168
+ const target = this._searchPossibleTargets(this.getSearchTargets(), this.getViewportPoint(e));
15169
15169
  return {
15170
15170
  target,
15171
15171
  targets: [...this.targets]
@@ -15696,7 +15696,7 @@
15696
15696
  * @returns
15697
15697
  */
15698
15698
  switchIsolateObject(e) {
15699
- if (!this.isolatedObject || this._searchTargets) return false;
15699
+ if (!this.isolatedObject || this._fixedSearchTargets) return false;
15700
15700
  let isolatedObject = null;
15701
15701
  if (this.isolatedObject.parent) {
15702
15702
  const parents = [];
@@ -15707,12 +15707,12 @@
15707
15707
  }
15708
15708
  // check topmost parent, if it was clicked, find the nearest child object to isolate
15709
15709
  const topmostParent = parents[parents.length - 1];
15710
- this.setSearchTargets([topmostParent]);
15710
+ this.setFixedSearchTargets([topmostParent]);
15711
15711
  let target = this.findTarget(e);
15712
15712
  // parent was clicked
15713
15713
  if (target) {
15714
15714
  parents.some(parent => {
15715
- this.setSearchTargets(parent.getObjects());
15715
+ this.setFixedSearchTargets(parent.getObjects());
15716
15716
  target = this.findTarget(e);
15717
15717
  if (target) {
15718
15718
  isolatedObject = parent;
@@ -15725,7 +15725,7 @@
15725
15725
  return false;
15726
15726
  });
15727
15727
  }
15728
- this.setSearchTargets(null);
15728
+ this.setFixedSearchTargets(null);
15729
15729
  }
15730
15730
  this.isolatedObject = isolatedObject;
15731
15731
  // use __onMouseDown select other object immediately after unlocking
@@ -16114,7 +16114,8 @@
16114
16114
  this.searchPossibleTargets(prevActiveObjects, pointer) ||
16115
16115
  // if not found, search under active selection for a target to add
16116
16116
  // `prevActiveObjects` will be searched but we already know they will not be found
16117
- this.searchPossibleTargets(this._objects, pointer);
16117
+ this.searchPossibleTargets(this.getSearchTargets(), pointer);
16118
+
16118
16119
  // if nothing is found bail out
16119
16120
  if (!target || !target.selectable) {
16120
16121
  return false;
@@ -16123,6 +16124,7 @@
16123
16124
  if (target.group === activeObject) {
16124
16125
  // `target` is part of active selection => remove it
16125
16126
  activeObject.remove(target);
16127
+ target.setCoords();
16126
16128
  this._hoveredTarget = target;
16127
16129
  this._hoveredTargets = [...this.targets];
16128
16130
  // if after removing an object we are left with one only...