@postermywall/fabricjs-2 6.0.0-pmw-2 → 6.0.0-pmw-3

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
@@ -125,6 +125,16 @@
125
125
  * @default
126
126
  */
127
127
  _defineProperty(this, "perfLimitSizeTotal", 2097152);
128
+ /**
129
+ * *PMW* added property to disable the drag group selection.
130
+ * @default
131
+ */
132
+ _defineProperty(this, "disableGroupSelector", void 0);
133
+ /**
134
+ * *PMW* added variable to mark when canvas is being two-finger panned.
135
+ * @type Boolean
136
+ */
137
+ _defineProperty(this, "isCanvasTwoFingerPanning", void 0);
128
138
  /**
129
139
  * Pixel limit for cache canvases width or height. IE fixes the maximum at 5000
130
140
  * @since 1.7.14
@@ -423,7 +433,7 @@
423
433
  }
424
434
  const cache = new Cache();
425
435
 
426
- var version = "6.0.0-pmw-2";
436
+ var version = "6.0.0-pmw-3";
427
437
 
428
438
  // use this syntax so babel plugin see this import here
429
439
  const VERSION = version;
@@ -9484,6 +9494,9 @@
9484
9494
  */
9485
9495
  _renderControls(ctx) {
9486
9496
  let styleOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9497
+ if (config.isCanvasTwoFingerPanning) {
9498
+ return;
9499
+ }
9487
9500
  const {
9488
9501
  hasBorders,
9489
9502
  hasControls
@@ -15039,6 +15052,9 @@
15039
15052
  } else if (!isClick && !((_this$_activeObject = this._activeObject) !== null && _this$_activeObject !== void 0 && _this$_activeObject.isEditing)) {
15040
15053
  this.renderTop();
15041
15054
  }
15055
+ if (config.isCanvasTwoFingerPanning) {
15056
+ config.isCanvasTwoFingerPanning = false;
15057
+ }
15042
15058
  }
15043
15059
  _basicEventHandler(eventType, options) {
15044
15060
  const {
@@ -15145,6 +15161,10 @@
15145
15161
  * @param {Event} e Event object fired on mousedown
15146
15162
  */
15147
15163
  __onMouseDown(e) {
15164
+ // *PMW* added condition. Skip the object transformation while the canvas is being two-finger panned.
15165
+ if ('touches' in e && e.touches.length === 2 || config.isCanvasTwoFingerPanning) {
15166
+ return;
15167
+ }
15148
15168
  this._isClick = true;
15149
15169
  this._cacheTransformEventData(e);
15150
15170
  this._handleEvent(e, 'down:before');
@@ -15187,7 +15207,7 @@
15187
15207
  // target is not selectable ( otherwise we selected it )
15188
15208
  // target is not editing
15189
15209
  // target is not already selected ( otherwise we drag )
15190
- if (this.selection && (!target || !target.selectable && !target.isEditing && target !== this._activeObject)) {
15210
+ if (this.selection && !config.disableGroupSelector && (!target || !target.selectable && !target.isEditing && target !== this._activeObject)) {
15191
15211
  const p = this.getScenePoint(e);
15192
15212
  this._groupSelector = {
15193
15213
  x: p.x,