@quinninc/pixi-transformer 0.0.7 → 0.0.8

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.
@@ -449,6 +449,12 @@ export class Transformer extends Pixi.Container {
449
449
  keyCodes.includes(e.code) && (that[property] = false);
450
450
  keyCodes.includes(e.key) && (that[property] = false);
451
451
  }));
452
+ window.addEventListener("blur", () => {
453
+ that[property] = false;
454
+ });
455
+ window.addEventListener("focus", () => {
456
+ that[property] = false;
457
+ });
452
458
  }
453
459
  createHandle({ cursor, name, shape = "square", }) {
454
460
  const handle = new Pixi.Graphics();
@@ -495,6 +501,9 @@ export class Transformer extends Pixi.Container {
495
501
  this.unselect();
496
502
  return;
497
503
  }
504
+ if (this.target) {
505
+ this.unselect();
506
+ }
498
507
  // console.log("select this - ", this);
499
508
  this.target = target;
500
509
  let _anchor;
@@ -520,6 +529,9 @@ export class Transformer extends Pixi.Container {
520
529
  unselect() {
521
530
  this.target = null;
522
531
  this.visible = false;
532
+ this.pivotKey = false;
533
+ this.snapKey = false;
534
+ this.dragging = false;
523
535
  this.onUpdate();
524
536
  }
525
537
  update() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quinninc/pixi-transformer",
3
3
  "private": false,
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "repository": {
6
6
  "url": "https://github.com/Quinn-Care-Private-Limited/pixi-transformer"
7
7
  },