修复标注移动位置后撤销,文字丢失的问题

pull/456/head
ChenX 5 years ago
parent b0187b0156
commit 76ff780d1b

@ -144,19 +144,27 @@ export class AlignedDimension extends Entity
let arrow1 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial); let arrow1 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
let arrow2 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial); let arrow2 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
this.RepairText();
obj.add(line, arrow1, arrow2, this._Text.DrawObject);
this.UpdateDrawObject(renderType, obj);
return obj;
}
/** /**
* ,Clone,Dispose,Text.Object * ,Clone,Dispose,Text.Object
* . * .
*/ */
private RepairText()
{
let tObj = this._Text.DrawObject; let tObj = this._Text.DrawObject;
if (tObj.children.length === 0) if (tObj.children.length === 0)
{
this._Text.ClearDraw();
tObj.add(this._Text.GetDrawObjectFromRenderType()); tObj.add(this._Text.GetDrawObjectFromRenderType());
}
obj.add(line, arrow1, arrow2, this._Text.DrawObject);
this.UpdateDrawObject(renderType, obj);
return obj;
} }
UpdateDrawObject(type: RenderType, obj: Object3D) UpdateDrawObject(type: RenderType, obj: Object3D)
@ -190,6 +198,8 @@ export class AlignedDimension extends Entity
this._Text.TextString = FixedNotZero(this.m_ArmP1.distanceTo(this.m_ArmP2), 2); this._Text.TextString = FixedNotZero(this.m_ArmP1.distanceTo(this.m_ArmP2), 2);
this._Text.Position = midPoint(this.m_ArmP1, this.m_ArmP2); this._Text.Position = midPoint(this.m_ArmP1, this.m_ArmP2);
this._Text.TextRotation = textRo; this._Text.TextRotation = textRo;
this.RepairText();
} }
GetObjectSnapPoints( GetObjectSnapPoints(

Loading…
Cancel
Save