@urso/core 0.6.13 → 0.6.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -125,7 +125,7 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
125
125
  .filter((container) => container._baseObject.worldVisible)
126
126
  .filter((container) => !container._needBlock)
127
127
  .filter((container) => {
128
- let height = container.getAbsoluteSize().height;
128
+ const height = container.getAbsoluteSize().height;
129
129
  return container.height - height < 0;
130
130
  })
131
131
  .sort((firstContainer, secondContainer) => secondContainer.dragIndex - firstContainer.dragIndex);
@@ -184,30 +184,17 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
184
184
  * @returns { Array }
185
185
  */
186
186
  _getObjectPoints(container) {
187
- if (Urso.device.desktop) {
188
- const { x, y } = this._getScaleAndPositionRecursive(this);
189
- const { width, height } = container._mask;
190
- const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
191
-
192
- return [
193
- { x, y },
194
- { x: x + width * scaleX, y },
195
- { x: x + width * scaleX, y: y + height * scaleY },
196
- { x, y: y + height * scaleY }
197
- ];
198
-
199
- } else {
200
- const { x, y } = container._mask.toGlobal(new PIXI.Point(0, 0));
201
- const { width, height } = container._mask;
202
- const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
203
- return [
204
- { x, y },
205
- { x: x + width * scaleX, y },
206
- { x: x + width * scaleX, y: y + height * scaleY },
207
- { x, y: y + height * scaleY }
208
- ];
209
- }
187
+ const { x, y } = container._mask.toGlobal(new PIXI.Point(0, 0));
188
+
189
+ const { width, height } = container._mask;
190
+ const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
210
191
 
192
+ return [
193
+ { x, y },
194
+ { x: x + width * scaleX, y },
195
+ { x: x + width * scaleX, y: y + height * scaleY },
196
+ { x, y: y + height * scaleY }
197
+ ];
211
198
  }
212
199
 
213
200
  /**
@@ -495,19 +482,13 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
495
482
  * Drags container on pointer move.
496
483
  * @param { Object } event
497
484
  */
498
- _onPointerMove(event) {
485
+ _onPointerMove(event) {
499
486
  let { data: { global: { x, y } } } = event;
500
487
 
501
- if (Urso.device.desktop) {
502
- x = Urso.scenes.getMouseCoords().x;
503
- y = Urso.scenes.getMouseCoords().y;
504
- }
505
-
506
488
  if (!this._startPosition) {
507
489
  this._startPosition = { x, y };
508
490
  }
509
491
 
510
-
511
492
  if (!this._isActive({ x, y })) {
512
493
  this._moveInProgress = false;
513
494
  return;
@@ -633,6 +614,7 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
633
614
  this._moveStartedY = event.changedTouches[0].offsetY || event.changedTouches[0].clientY;
634
615
  this._documentPointerStart(event);
635
616
  break;
617
+ case 'mousemove':
636
618
  case 'touchmove':
637
619
  this._documentPointerMove(event);
638
620
  break;
@@ -643,9 +625,6 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
643
625
  case 'wheel':
644
626
  this._documentWheelScroll(event);
645
627
  break;
646
- case 'pointermove':
647
- this._onPointerMove(event);
648
- break;
649
628
  default:
650
629
  break;
651
630
  }