Skip to content

Commit

Permalink
Merge pull request #526 from sharefe-demo/feat_alpha/opt-pointcloud-r…
Browse files Browse the repository at this point in the history
…esult-json

fix: optimize the 2d connnection relative
  • Loading branch information
lihqi authored Jul 23, 2024
2 parents 7c51a55 + 29207ff commit 3f6b518
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,20 @@ 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) {
// 是否使用强制默认值,如: lineDash: [3]
const shouldNotUseForceValue = rect?.boxID || rect?.lineDash;
const targetRect = this.getComputedDrawingRect(rect);
// window.console.log('[@DrawingRect] Rect: ', targetRect, ', Origin Rect: ', rect);

super.renderDrawingRect(shouldNotUseForceValue ? rect : { ...rect, lineDash: [3] }, zoom, isZoom);
super.renderDrawingRect(targetRect, zoom, isZoom);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ export const PointCloudProvider: React.FC<PropsWithChildren<{}>> = ({ children }
attribute: attribute,
order: trackID,
extId: id,
lineDash: [],
};
}

Expand Down

0 comments on commit 3f6b518

Please sign in to comment.