|
|
|
@ -21,6 +21,7 @@ import { AxSelection } from './model/axSelection';
|
|
|
|
|
import { AxMessageSystem } from './model/axMessageSystem'; |
|
|
|
|
import { Grid2D } from './model/grid2D'; |
|
|
|
|
import { Viewport } from 'pixi-viewport'; |
|
|
|
|
import { EVENT_SELECTION_CHANGED } from './model/events'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@ -156,7 +157,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
* RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 |
|
|
|
|
* Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 |
|
|
|
|
*/ |
|
|
|
|
public VERSION = '1.0.14.20210202_beta'; |
|
|
|
|
public VERSION = '1.0.15.20210202_beta'; |
|
|
|
|
/** |
|
|
|
|
* 数据初始化 |
|
|
|
|
*/ |
|
|
|
@ -232,7 +233,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.selection.clear(); |
|
|
|
|
this.emit('canvasDataChanged'); |
|
|
|
|
this.canvasData.isChange = true; |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -371,7 +372,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.camera2D.on('pointerdown', event => { |
|
|
|
|
if (this.isCtrlKeyClicked === true) { |
|
|
|
|
if (this.isCtrlKeyClicked === true |
|
|
|
|
&& event.data.button === 0) { |
|
|
|
|
this.rectToolGraphics.visible = true; |
|
|
|
|
this.initialScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); |
|
|
|
|
this.finalScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); |
|
|
|
@ -424,7 +426,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
const final = this.finalScreenMousePos; |
|
|
|
|
|
|
|
|
|
this.rectToolGraphics.clear(); |
|
|
|
|
this.rectToolGraphics.lineStyle(2, 0x00ff00, 1); |
|
|
|
|
this.rectToolGraphics.lineStyle(1 / this.camera2D.scale.x, 0x00ff00, 1); |
|
|
|
|
this.rectToolGraphics.beginFill(0xccccf2, 0.25); |
|
|
|
|
if (final.x > init.x && final.y > init.y) { |
|
|
|
|
this.rectToolGraphics.drawRect(init.x, init.y, final.x - init.x, final.y - init.y); |
|
|
|
@ -438,6 +440,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.rectToolGraphics.endFill(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// 右键事件
|
|
|
|
|
this.camera2D.on('rightclick', event => { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
this.deselectAll(); |
|
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -489,28 +497,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position); |
|
|
|
|
this.refreshPreviewPoint(); |
|
|
|
|
} |
|
|
|
|
// /**
|
|
|
|
|
// * 显示框选
|
|
|
|
|
// */
|
|
|
|
|
// if (this.rectToolGraphics.visible === true) {
|
|
|
|
|
|
|
|
|
|
// const init = this.initialScreenMousePos;
|
|
|
|
|
// const final = this.finalScreenMousePos;
|
|
|
|
|
|
|
|
|
|
// this.rectToolGraphics.clear();
|
|
|
|
|
// this.rectToolGraphics.lineStyle(2, 0x00ff00, 1);
|
|
|
|
|
// this.rectToolGraphics.beginFill(0xccccf2, 0.25);
|
|
|
|
|
// if (final.x > init.x && final.y > init.y) {
|
|
|
|
|
// this.rectToolGraphics.drawRect(init.x, init.y, final.x - init.x, final.y - init.y);
|
|
|
|
|
// } else if (final.x > init.x && final.y < init.y) {
|
|
|
|
|
// this.rectToolGraphics.drawRect(init.x, final.y, final.x - init.x, init.y - final.y);
|
|
|
|
|
// } else if (final.x < init.x && final.y > init.y) {
|
|
|
|
|
// this.rectToolGraphics.drawRect(final.x, init.y, init.x - final.x, final.y - init.y);
|
|
|
|
|
// } else if (final.x < init.x && final.y < init.y) {
|
|
|
|
|
// this.rectToolGraphics.drawRect(final.x, final.y, init.x - final.x, init.y - final.y);
|
|
|
|
|
// }
|
|
|
|
|
// this.rectToolGraphics.endFill();
|
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* 创建图标事件(数据处理) |
|
|
|
@ -976,11 +962,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}) |
|
|
|
|
.on('rightclick', event => { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
this.deselectAll(); |
|
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
|
}) |
|
|
|
|
// .on('rightclick', event => {
|
|
|
|
|
// event.stopPropagation();
|
|
|
|
|
// this.deselectAll();
|
|
|
|
|
// this.setPaintMode(PaintMode.endPaint);
|
|
|
|
|
// })
|
|
|
|
|
.on('pointerover', (event) => { |
|
|
|
|
if (this.previewImage !== null |
|
|
|
|
&& this.paintMode === PaintMode.singlePointIcon) { |
|
|
|
@ -1571,7 +1557,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} |
|
|
|
|
this.selection.add(shape); |
|
|
|
|
this.setSelectEffect(shape); |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 选择 |
|
|
|
@ -1588,18 +1574,20 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
} |
|
|
|
|
this.selection.add(shape); |
|
|
|
|
this.setSelectEffect(shape); |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 选择集合中的形状 |
|
|
|
|
* @param shape 形状集合 |
|
|
|
|
*/ |
|
|
|
|
public selectAll(shape: AxShape[]) { |
|
|
|
|
this.selection.addArray(shape); |
|
|
|
|
this.selection.all().forEach(item => { |
|
|
|
|
if (shape.length > 0) { |
|
|
|
|
this.selection.addArray(shape); |
|
|
|
|
this.selection.all().forEach(item => { |
|
|
|
|
this.setSelectEffect(item); |
|
|
|
|
}); |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 先清空再选择全部 |
|
|
|
@ -1616,7 +1604,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.selection.all().forEach(item => { |
|
|
|
|
this.setSelectEffect(item); |
|
|
|
|
}); |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 选择集合中所有id的形状 |
|
|
|
@ -1640,7 +1628,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
this.clearSelectEffect(item); |
|
|
|
|
}); |
|
|
|
|
this.selection.clear(); |
|
|
|
|
AxMessageSystem.send(CanvasAction.selectionChanged); |
|
|
|
|
AxMessageSystem.send(EVENT_SELECTION_CHANGED); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
@ -1672,7 +1660,3 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
legend.visible = b; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
enum CanvasAction { |
|
|
|
|
selectionChanged = 'selectionChanged', |
|
|
|
|
copyDataChanged = 'copyDataChanged' |
|
|
|
|
} |
|
|
|
|