diff --git a/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts b/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts index 5e4afbf00..f765a9c66 100644 --- a/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts @@ -83,20 +83,11 @@ class PointCloud2DRectOperation extends RectOperation { return true; } - private getComputedDrawingRect(rect: IPointCloud2DRectOperationViewRect & IRect) { - const keyOfExtId = 'extId'; - // Is it 3d's projected or disconnected 3d's projected rect - // @ts-ignore - const shouldNotDashedLine = rect?.boxID || rect?.[keyOfExtId]; - - return shouldNotDashedLine ? rect : { ...rect, lineDash: [3] }; - } - public renderDrawingRect(rect: IPointCloud2DRectOperationViewRect & IRect, zoom = this.zoom, isZoom = false) { - const targetRect = this.getComputedDrawingRect(rect); - // window.console.log('[@DrawingRect] Rect: ', targetRect, ', Origin Rect: ', rect); + // 是否使用强制默认值,如: lineDash: [3] + const shouldNotUseForceValue = rect?.boxID || rect?.lineDash; - super.renderDrawingRect(targetRect, zoom, isZoom); + super.renderDrawingRect(shouldNotUseForceValue ? rect : { ...rect, lineDash: [3] }, zoom, isZoom); } /* diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudContext.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudContext.tsx index c1f34511b..48ed89415 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudContext.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudContext.tsx @@ -385,6 +385,7 @@ export const PointCloudProvider: React.FC> = ({ children } attribute: attribute, order: trackID, extId: id, + lineDash: [], }; }