From ae54aa411a9de6dfe7ba448883385a360b608fb5 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 7 Sep 2020 16:13:22 +0800 Subject: [PATCH 1/7] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=B6=88=E9=98=B2?= =?UTF-8?q?=E8=A6=81=E7=B4=A0=E6=A0=91=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools/collection-tools.component.html | 12 ++++++++---- .../collection-tools/collection-tools.component.scss | 7 +++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 3b47c75..4c23885 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -304,8 +304,10 @@ - {{node.name}} - ({{node.children.length}}) + + {{node.name}} + + ({{node.children.length}}) visibility @@ -318,8 +320,10 @@ {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} - {{node.name}} - ({{node.children.length}}) + + {{node.name}} + + ({{node.children.length}}) visibility diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 2d00da5..04144b9 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -301,4 +301,11 @@ div:focus { } .isLookPattern{ display: none; +} +.treeText{ + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: inline-block; + width: 65px; } \ No newline at end of file From 0a29dd1fa66719bd2e352ac0b72d61e7d84928a2 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 7 Sep 2020 16:37:17 +0800 Subject: [PATCH 2/7] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E8=B0=83=E7=94=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/collection-tools/collection-tools.component.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index b1eec19..4458d66 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -490,6 +490,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -507,6 +508,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -526,6 +528,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -544,6 +547,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -562,6 +566,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -580,6 +585,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -597,6 +603,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -616,6 +623,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -634,6 +642,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -652,6 +661,7 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ + this.canvas.refresh() let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 From 867848f34218b4c28fa59b622d0164ebee103371 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Mon, 7 Sep 2020 16:46:28 +0800 Subject: [PATCH 3/7] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=9B=BE=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 3457eb1..a2144f6 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -564,6 +564,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public destroyBackgroundImage(): void { this.app.stage.removeChild(this.backgroundImage); } + /** + * 设置背景图缩放 + * @param scale 缩放系数 + */ + public setBackgroundScale(scale: number): void { + this.backgroundImage.scale.set(scale); + } /** * 设置背景图角度 * @param imageAngle 角度值 From 7a483d60c64353d641123464ad7a4bd29a79182f Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Mon, 7 Sep 2020 17:25:18 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index a2144f6..c9ab928 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -817,7 +817,9 @@ enum PaintMode { * 单点图标 */ export class SinglePointIcon extends PIXI.Container { - private text = new PIXI.Text(this.assetData.Name, { + private text = new PIXI.Text(this.assetData.Name + + '\r\n' + + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, { fontFamily: 'Arial', fontSize: 18, fill: 0xffffff, align: 'center' }); constructor(public assetData: any, private workingArea: WorkingAreaComponent) { @@ -838,7 +840,7 @@ export class SinglePointIcon extends PIXI.Container { singlePointIcon .on('mousedown', event => { event.stopPropagation(); - + console.log(this.assetData); event.currentTarget.parent.data = event.data; event.currentTarget.parent.alpha = 0.5; event.currentTarget.parent.dragging = true; @@ -875,8 +877,8 @@ export class SinglePointIcon extends PIXI.Container { }); this.text.x = singlePointIcon.x; - this.text.y = singlePointIcon.y - 32; - this.text.anchor.set(0.5); + this.text.y = singlePointIcon.y - singlePointIcon.height / 2; + this.text.anchor.set(0.5, 1); this.addChild(this.text); this.addChild(singlePointIcon); From 5a921d5bf100c8f427052037bb3829f7281a5105 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Tue, 8 Sep 2020 09:34:18 +0800 Subject: [PATCH 5/7] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AD=97=E4=BD=93=EF=BC=8C=E9=98=B2=E6=AD=A2=E4=B8=8E=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E5=90=8C=E8=89=B2=E8=83=8C=E6=99=AF=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 64 +++++++++++++++++-- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index c9ab928..9891df1 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -817,11 +817,27 @@ enum PaintMode { * 单点图标 */ export class SinglePointIcon extends PIXI.Container { + style = new PIXI.TextStyle({ + fontFamily: 'Arial', + fontSize: 18, + fontStyle: 'normal', + fontWeight: 'bold', + fill: ['#000000'], + stroke: '#00ff99', + strokeThickness: 3, + dropShadow: true, + dropShadowColor: '#000000', + dropShadowBlur: 3, + dropShadowAngle: Math.PI / 6, + dropShadowDistance: 1, + wordWrap: false, + wordWrapWidth: 100, + }); + private text = new PIXI.Text(this.assetData.Name + '\r\n' - + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, { - fontFamily: 'Arial', fontSize: 18, fill: 0xffffff, align: 'center' - }); + + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); + constructor(public assetData: any, private workingArea: WorkingAreaComponent) { super(); this.workingArea.backgroundImage.addChild(this); @@ -897,9 +913,26 @@ export class MultipointIcon extends PIXI.Container { public pointsData: PIXI.Point[]; public pointsGraphics: PIXI.Graphics[] = []; public iconsTilingSprite: PIXI.TilingSprite[] = []; - private text = new PIXI.Text(this.assetData.Name, { - fontFamily: 'Arial', fontSize: 18, fill: 0xffffff, align: 'center' + style = new PIXI.TextStyle({ + fontFamily: 'Arial', + fontSize: 18, + fontStyle: 'normal', + fontWeight: 'bold', + fill: ['#000000'], + stroke: '#00ff99', + strokeThickness: 3, + dropShadow: true, + dropShadowColor: '#000000', + dropShadowBlur: 3, + dropShadowAngle: Math.PI / 6, + dropShadowDistance: 1, + wordWrap: false, + wordWrapWidth: 100, }); + + private text = new PIXI.Text(this.assetData.Name + + '\r\n' + + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); /** * * @param texture 图片素材 @@ -1097,9 +1130,26 @@ export class PolygonIcon extends PIXI.Container { public pointsGraphics: PIXI.Graphics[] = []; public polygonGraphics: PIXI.Graphics = new PIXI.Graphics(); public polygonLineGraphics: PIXI.Graphics = new PIXI.Graphics(); - private text = new PIXI.Text(this.assetData.Name, { - fontFamily: 'Arial', fontSize: 18, fill: 0xffffff, align: 'center' + style = new PIXI.TextStyle({ + fontFamily: 'Arial', + fontSize: 18, + fontStyle: 'normal', + fontWeight: 'bold', + fill: ['#000000'], + stroke: '#00ff99', + strokeThickness: 3, + dropShadow: true, + dropShadowColor: '#000000', + dropShadowBlur: 3, + dropShadowAngle: Math.PI / 6, + dropShadowDistance: 1, + wordWrap: false, + wordWrapWidth: 100, }); + + private text = new PIXI.Text(this.assetData.Name + + '\r\n' + + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); /** * * @param points 点集合 From c7bb9833c0e6b8b87b165dc089b8fa9be14a4499 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Tue, 8 Sep 2020 09:37:31 +0800 Subject: [PATCH 6/7] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E7=B4=A0=E6=9D=90?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=B4=A0=E6=9D=90=E5=AE=BD=E9=AB=98=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 6 +-- .../collection-tools.component.ts | 42 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 4c23885..a004149 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -165,11 +165,11 @@

{{assetName}}

-
+

宽度(像素)

- +

高度(像素)

- +

角度

{ }); } - //上传素材图片 selectFile(e){ let imgFile = e.target.files[0] || null //上传的文件 @@ -391,6 +391,7 @@ export class CollectionToolsComponent implements OnInit { ngAfterViewInit(): void { // 监听canvas组件选中素材事件 this.canvas.on("select",obj=>{ + console.log(obj.assetData) //选中素材属性注入函数 this.setAssetsProperty(obj.assetData) }) @@ -486,11 +487,11 @@ export class CollectionToolsComponent implements OnInit { }else{ //如果是单位 总平面图 if(this.checkedBuildingIndex==-1){ + //保存平面图数据 this.http.post("/api/CompanyAccount/SitePlanData",SitePlanData).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -504,11 +505,11 @@ export class CollectionToolsComponent implements OnInit { this.snackBar.open('平面图数据保存失败','确定',config); }) + //保存建筑数据 this.http.post("/api/CompanyAccount/CompanyData",CompanyData).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -525,10 +526,9 @@ export class CollectionToolsComponent implements OnInit { //批量保存单位毗邻 let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() this.http.post("/api/CompanyAccount/CompanyAdjoins/Batch",CompanyAdjoins).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -541,13 +541,13 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = true this.snackBar.open('单位毗邻保存失败','确定',config); }) + //批量保存单位重点部位 let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() this.http.post("/api/CompanyAccount/CompanyImportantLocations/Batch",CompanyImportantLocations).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -560,13 +560,13 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = true this.snackBar.open('单位重点部位保存失败','确定',config); }) + //批量保存单位消防设施素材 let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() this.http.post("/api/CompanyAccount/CompanyFacilityAssets/Batch",CompanyFacilityAssets).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -579,13 +579,14 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = true this.snackBar.open('单位消防设施素材保存失败','确定',config); }) + }else{ //如果是建筑 + //建筑平面图数据 this.http.post("/api/CompanyAccount/BuildingAreaData",SitePlanData).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -599,11 +600,11 @@ export class CollectionToolsComponent implements OnInit { this.snackBar.open('平面图数据保存失败','确定',config); }) + //建筑数据 this.http.post("/api/CompanyAccount/BuildingData",CompanyData).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -620,10 +621,9 @@ export class CollectionToolsComponent implements OnInit { //批量保存建筑毗邻 let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() this.http.post(`/api/CompanyAccount/BuildingAdjoins/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -636,13 +636,13 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = true this.snackBar.open('建筑毗邻保存失败','确定',config); }) + //批量保存建筑重点部位 let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() this.http.post(`/api/CompanyAccount/BuildingImportantLocations/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -655,13 +655,13 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.isChange = true this.snackBar.open('建筑重点部位保存失败','确定',config); }) + //批量保存建筑消防设施素材 let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => { - this.canvasData.isChange = false this.saveNum.push("1") if(this.saveNum.length == 5){ - this.canvas.refresh() + this.canvasData.isChange = false let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 From fd078d358418fdb35550506fdfd69800060011f0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Tue, 8 Sep 2020 10:11:23 +0800 Subject: [PATCH 7/7] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20=E5=8D=95=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BC=A9=E6=94=BE=E5=9B=BA=E5=AE=9A=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 9891df1..4d9e2f7 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -140,6 +140,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (delta > 0) { if (this.backgroundImage.scale.x >= 32) { this.backgroundImage.scale.x = 32; + this.backgroundImage.scale.y = 32; + this.emit('mouseWheel', this.backgroundImage.scale.x); return; } this.backgroundImage.pivot.set(pivot.x, pivot.y); @@ -151,7 +153,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.backgroundImage.position.y += delY; } else if (delta < 0) { if (this.backgroundImage.scale.x <= 0.1) { + this.backgroundImage.scale.x = 0.1; this.backgroundImage.scale.y = 0.1; + this.emit('mouseWheel', this.backgroundImage.scale.x); return; } this.backgroundImage.pivot.set(pivot.x, pivot.y); @@ -162,6 +166,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.backgroundImage.position.x += delX; this.backgroundImage.position.y += delY; } + this.emit('mouseWheel', this.backgroundImage.scale.x); } /** * 创建画布 @@ -845,8 +850,8 @@ export class SinglePointIcon extends PIXI.Container { this.y = this.assetData.Point.y; this.name = this.assetData.Id; const singlePointIcon = PIXI.Sprite.from(this.assetData.ImageUrl); - singlePointIcon.x = 0; // this.assetData.Point.x; - singlePointIcon.y = 0; // this.assetData.Point.y; + singlePointIcon.x = 0; + singlePointIcon.y = 0; singlePointIcon.width = this.assetData.Width; singlePointIcon.height = this.assetData.Height; @@ -892,6 +897,14 @@ export class SinglePointIcon extends PIXI.Container { }); + this.workingArea.on('mouseWheel', data => { + if (this.assetData.FixedSize) { + const scale = 1 / data; + console.log(scale); + this.scale.set(scale); + } + }); + this.text.x = singlePointIcon.x; this.text.y = singlePointIcon.y - singlePointIcon.height / 2; this.text.anchor.set(0.5, 1);