Browse Source

修复bug: 测量工具没有正确释放的问题

beijing
刘向辉 2 years ago
parent
commit
73a0672108
  1. 16
      src/app/babylon/tool/measure-tool.ts
  2. 123
      src/assets/js/meshopt_decoder.js

16
src/app/babylon/tool/measure-tool.ts

@ -2,6 +2,7 @@ import { EventState, Mesh, MeshBuilder, PickingInfo, PointerEventTypes, PointerI
import { Button, Container, Control, Ellipse, MultiLine, Rectangle, TextBlock } from "@babylonjs/gui";
import { UIManager } from "../controller/ui-manager";
import { BabylonUIStyleTool } from "./babylon-ui-style-tool";
import { TsTool } from "./ts-tool";
/**
*
@ -114,13 +115,24 @@ export class MeasureTool {
*
*/
clearMeasure() {
for (let i = 0; i < this.allMeasureInfo.length; i++) {
this.allMeasureInfo[i].dispose();
}
this.allMeasureInfo = [];
}
/**
* info
* @param info
*/
disposeMeasureInfo(info: MeasureInfo) {
TsTool.arrayRemove(MeasureTool.instance.allMeasureInfo, info);
if (this.currentMeasureInfo == info) {
this.currentMeasureInfo = null;
}
info.dispose();
}
/**
*
*/
@ -296,7 +308,7 @@ export class MeasureInfo {
this.btn_dispose.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
let instance = this;
this.btn_dispose.onPointerClickObservable.add(() => {
instance.dispose();
MeasureTool.instance.disposeMeasureInfo(instance);
});
this.btn_dispose.background = BabylonUIStyleTool.c_color_3d_blueBg;
this.btn_dispose.color = BabylonUIStyleTool.c_color_3d_blue;

123
src/assets/js/meshopt_decoder.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save