|
|
|
@ -42,7 +42,7 @@ export class AxShape extends Graphics {
|
|
|
|
|
} |
|
|
|
|
if (this.allowEdit) { |
|
|
|
|
this.mouseDragging = true; |
|
|
|
|
this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); |
|
|
|
|
this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.on('pointerup', event => { |
|
|
|
@ -53,15 +53,26 @@ export class AxShape extends Graphics {
|
|
|
|
|
}) |
|
|
|
|
.on('pointermove', event => { |
|
|
|
|
if (this.mouseDragging) { |
|
|
|
|
// const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
|
|
|
|
|
// const x = newPosition.x - this.x;
|
|
|
|
|
// const y = newPosition.y - this.y;
|
|
|
|
|
// this.workingArea.selection.all().forEach(item => {
|
|
|
|
|
// item.x += x;
|
|
|
|
|
// item.y += y;
|
|
|
|
|
// item.assetData.Point = new PIXI.Point(item.x, item.y);
|
|
|
|
|
// this.workingArea.canvasData.isChange = true;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage); |
|
|
|
|
const offsetX = newPosition.x - this.mousePosition.x; |
|
|
|
|
const offsetY = newPosition.y - this.mousePosition.y; |
|
|
|
|
this.workingArea.selection.all().forEach(item => { |
|
|
|
|
const x = event.data.global.x - this.mousePosition.x; |
|
|
|
|
const y = event.data.global.y - this.mousePosition.y; |
|
|
|
|
item.x += x * (1 / this.workingArea.camera2D.scale.x); |
|
|
|
|
item.y += y * (1 / this.workingArea.camera2D.scale.y); |
|
|
|
|
item.x += offsetX; |
|
|
|
|
item.y += offsetY; |
|
|
|
|
item.assetData.Point = new PIXI.Point(item.x, item.y); |
|
|
|
|
this.workingArea.canvasData.isChange = true; |
|
|
|
|
}); |
|
|
|
|
this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); |
|
|
|
|
this.mousePosition = newPosition; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.on('rightclick', event => { |
|
|
|
|