Browse Source

修改事件名称

develop
徐振升 4 years ago
parent
commit
5bdc1d8b22
  1. 10
      src/app/working-area/working-area.component.ts

10
src/app/working-area/working-area.component.ts

@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.backgroundImage.scale.x >= 32) { if (this.backgroundImage.scale.x >= 32) {
this.backgroundImage.scale.x = 32; this.backgroundImage.scale.x = 32;
this.backgroundImage.scale.y = 32; this.backgroundImage.scale.y = 32;
this.emit('mouseWheel', this.backgroundImage.scale.x); this.emit('backgroundScale', this.backgroundImage.scale.x);
return; return;
} }
this.backgroundImage.pivot.set(pivot.x, pivot.y); this.backgroundImage.pivot.set(pivot.x, pivot.y);
@ -155,7 +155,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.backgroundImage.scale.x <= 0.1) { if (this.backgroundImage.scale.x <= 0.1) {
this.backgroundImage.scale.x = 0.1; this.backgroundImage.scale.x = 0.1;
this.backgroundImage.scale.y = 0.1; this.backgroundImage.scale.y = 0.1;
this.emit('mouseWheel', this.backgroundImage.scale.x); this.emit('backgroundScale', this.backgroundImage.scale.x);
return; return;
} }
this.backgroundImage.pivot.set(pivot.x, pivot.y); this.backgroundImage.pivot.set(pivot.x, pivot.y);
@ -166,7 +166,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.backgroundImage.position.x += delX; this.backgroundImage.position.x += delX;
this.backgroundImage.position.y += delY; this.backgroundImage.position.y += delY;
} }
this.emit('mouseWheel', this.backgroundImage.scale.x); this.emit('backgroundScale', this.backgroundImage.scale.x);
} }
/** /**
* *
@ -586,7 +586,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*/ */
public setBackgroundScale(scale: number): void { public setBackgroundScale(scale: number): void {
this.backgroundImage.scale.set(scale); this.backgroundImage.scale.set(scale);
this.emit('mouseWheel', this.backgroundImage.scale.x); this.emit('backgroundScale', this.backgroundImage.scale.x);
} }
/** /**
* *
@ -910,7 +910,7 @@ export class SinglePointIcon extends PIXI.Container {
}); });
this.workingArea.on('mouseWheel', data => { this.workingArea.on('backgroundScale', data => {
if (this.assetData.FixedSize) { if (this.assetData.FixedSize) {
const scale = 1 / data; const scale = 1 / data;
console.log(scale); console.log(scale);

Loading…
Cancel
Save