@@ -47,6 +47,7 @@ import _ from 'lodash';
4747import PointCloudSizeSlider from './components/PointCloudSizeSlider' ;
4848import { useHistory } from './hooks/useHistory' ;
4949import TitleButton from './components/TitleButton' ;
50+ import { useDebounceFn } from 'ahooks' ;
5051
5152const { EPolygonPattern, EToolName } = cTool ;
5253const { ESortDirection } = cAnnotation ;
@@ -208,6 +209,9 @@ const PointCloudTopView: React.FC<IProps> = ({
208209 const size = useSize ( ref ) ;
209210 const config = jsonParser ( stepInfo . config ) ;
210211 const { setZoom, syncTopviewToolZoom } = useZoom ( ) ;
212+
213+ const { run : debouncedSetZoom } = useDebounceFn ( setZoom , { wait : 500 } ) ;
214+
211215 const { hideAttributes, setIsLargeStatus, selectedID, pointCloudBoxList } = ptCtx ;
212216
213217 const { addPolygon, deletePolygon } = usePolygon ( ) ;
@@ -423,8 +427,7 @@ const PointCloudTopView: React.FC<IProps> = ({
423427
424428 pointCloud . camera . updateProjectionMatrix ( ) ;
425429 pointCloud . render ( ) ;
426-
427- setZoom ( zoom ) ;
430+ debouncedSetZoom ( zoom ) ;
428431 syncTopviewToolZoom ( currentPos , zoom , size ) ;
429432 setAnnotationPos ( { zoom, currentPos } ) ;
430433 } ) ;
0 commit comments