Browse Source

修正选中集合返回

zhuzhou
徐振升 4 years ago
parent
commit
c50e55e6e7
  1. 4
      src/app/working-area/model/axSelection.ts
  2. 8
      src/app/working-area/working-area.component.ts

4
src/app/working-area/model/axSelection.ts

@ -8,7 +8,7 @@ export class AxSelection {
// 获得第一个对象
public first(): any {
if (this.objects.size > 0) {
return this.objects[0];
return [...this.objects][0];
} else {
return null;
}
@ -19,7 +19,7 @@ export class AxSelection {
}
// 获得所有对象
public all() {
return this.objects;
return [...this.objects];
}
// 获取集合长度
public size(): number {

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

@ -151,7 +151,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* RC版: 该版本已经相当成熟了BUG
* Release版: 该版本意味使Release不会以单词形式出现在软件封面上®
*/
public VERSION = '1.0.12.20210125_beta';
public VERSION = '1.0.13.20210126_beta';
/**
*
*/
@ -159,13 +159,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
PIXI.utils.skipHello();
this.sayHello();
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => {
event.stopPropagation()
event.stopPropagation();
if (event.keyCode === 17) {
this.isCtrlKeyClicked = true;
}
});
this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => {
event.stopPropagation()
event.stopPropagation();
if (event.keyCode === 17) {
this.isCtrlKeyClicked = false;
this.rectToolGraphics.visible = false;
@ -181,7 +181,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
public deleteSelectedShape() {
if (this.selection.all().size > 0) {
if (this.selection.size() > 0) {
this.selection.all().forEach(axShape => {
if (this.allowEdit && this.canvasData.gameMode === axShape.assetData.GameMode) {
// 删除图例对象

Loading…
Cancel
Save