From bd38a528a275ffa14db0c96a367ced6d9b916fcc Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Thu, 9 Dec 2021 09:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=9C=AC=E6=A1=86?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/info/mark/model-info-mark.ts | 32 ++++++++++++------- .../babylon/view/mark-window/mark-window.ts | 4 +-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/app/babylon/model/info/mark/model-info-mark.ts b/src/app/babylon/model/info/mark/model-info-mark.ts index d6dc2e3..665f505 100644 --- a/src/app/babylon/model/info/mark/model-info-mark.ts +++ b/src/app/babylon/model/info/mark/model-info-mark.ts @@ -141,8 +141,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead = Button.CreateSimpleButton('followHead_' + this.key, ""); UIManager.Instance.uiRoot.addControl(this.uiFollowHead); this.uiFollowHead.width = this.c_uiDefaultWidth + "px"; - this.uiFollowHead.height = "50px"; + this.uiFollowHead.height = "55px"; this.uiFollowHead.thickness = 0; + this.uiFollowHead.adaptWidthToChildren = true; this.uiFollowHead.linkWithMesh(this.headMesh); this.uiFollowHead.onPointerClickObservable.add(() => { MarkWindow.instance.selectMarkDataFrom3d(instance, true); @@ -161,6 +162,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead.addControl(this.uiNumber); this.uiNumber.width = 1; this.uiNumber.height = 0.5; + this.uiNumber.paddingTopInPixels = 5; + this.uiNumber.paddingLeft = 5; + this.uiNumber.paddingRight = 5; this.uiNumber.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; this.uiNumber.color = "white"; this.uiNumber.shadowBlur = 2; @@ -171,6 +175,9 @@ export class ModelInfo_mark extends ModelInfo { this.uiFollowHead.addControl(this.uiTask); this.uiTask.width = 1; this.uiTask.height = 0.5; + this.uiTask.paddingBottomInPixels = 2; + this.uiTask.paddingLeft = 5; + this.uiTask.paddingRight = 5; this.uiTask.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM this.uiTask.color = BabylonUIStyleTool.c_color_3d_blue; this.uiTask.shadowBlur = 1; @@ -178,6 +185,7 @@ export class ModelInfo_mark extends ModelInfo { this.uiTask.resizeToFit = true; this.updateProperty(); + // this.uiFollowHead.linkWithMesh(this.headMesh); } @@ -254,18 +262,18 @@ export class ModelInfo_mark extends ModelInfo { if (this.markData.property.taskType != MarkTask.None) { this.uiNumber.text = this.markData.property.getInstitutionNum(); this.uiTask.text = this.markData.property.task; - + this.uiNumber let instance = this; - setTimeout(() => { - if (instance.uiNumber == null) { - return; - } - let numWidth = instance.uiNumber.widthInPixels; - let taskWidth = instance.uiTask.widthInPixels; - let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth); - instance.uiFollowHead.widthInPixels = maxWidth; - // instance.uiFollowHeadBg.widthInPixels = maxWidth; - }, (100)); + // setTimeout(() => { + // if (instance.uiNumber == null) { + // return; + // } + // let numWidth = instance.uiNumber.widthInPixels; + // let taskWidth = instance.uiTask.widthInPixels; + // let maxWidth = Math.max(numWidth, taskWidth, this.c_uiDefaultWidth); + // instance.uiFollowHead.widthInPixels = maxWidth; + // // instance.uiFollowHeadBg.widthInPixels = maxWidth; + // }, (100)); // console.log("喷水", this.taskNeedWaterParticle()); if (this.taskNeedWaterParticle()) { diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index 9d9390f..274640a 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -7,9 +7,9 @@ import { DataManager } from "../../controller/data-manager"; import { EventManager } from "../../controller/event-manager/event-manager"; import { Event_GetAllMarkPlanData } from "../../controller/event-manager/events/event-get-markplandata-success"; import { Event_KeyboardInput } from "../../controller/event-manager/events/event-keyboard-input"; -import { Event_LoadingChange } from "../../controller/event-manager/events/event-loading-change"; import { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event-manager/events/event-mark-info-change"; import { InputController } from "../../controller/inputController"; +import { ModeManager, ModeType } from "../../controller/mode-manager"; import { SceneManager } from "../../controller/scene-manager"; import { BuildingStatus } from "../../controller/status/building-status"; import { IndoorStatus } from "../../controller/status/indoor-status"; @@ -799,7 +799,7 @@ export class MarkWindow extends UIBase { onPointerObservable(eventData: PointerInfo, eventState: EventState) { let instance = MarkWindow.instance; - if (!instance.isShow) { + if (!instance.isShow || ModeManager.currentMode != ModeType.Edit) { //查看模式不能调整预案 return; }