Skip to content

Commit

Permalink
Revert "Revert "feat: resolve cr of RectRotateSensitivitySlider""
Browse files Browse the repository at this point in the history
This reverts commit e610851.
  • Loading branch information
lihqi committed Jun 7, 2024
1 parent 563f87e commit e15624f
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/*
* @file Provides a slider component for adjusting the rotation angle sensitivity in a point cloud context.
* The slider allows values between 1 and 5, with marks at 0.5, 1, 2, 3, and 4.
* The current sensitivity value is managed via the PointCloudContext.
* @author Vincent He <[email protected]>
* @date 2024-06-05
*/
import React from 'react';
import { Slider } from 'antd';
import { IPointCloudContext } from '@/components/pointCloudView/PointCloudContext';
import useAnnotatedBoxStore from '@/store/annotatedBox';
import { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';
import { i18n } from '@labelbee/lb-utils';
import styles from './index.module.scss';

Expand All @@ -14,11 +20,10 @@ const marks = {
};

const RectRotateSensitivitySlider = () => {
const state = useAnnotatedBoxStore();
const ptCtx = state.ptCtx as IPointCloudContext;
const ptCtx = React.useContext(PointCloudContext);

const handleSliderChange = (value: number) => {
ptCtx.setRectRotateSensitivity(value); // 假设setRectRotateSensitivity是用于更新旋转灵敏度的方法
ptCtx.setRectRotateSensitivity(value);
};

return (
Expand All @@ -27,9 +32,9 @@ const RectRotateSensitivitySlider = () => {
<div className='toolStyle'>
<div id='style-rectRotateSensitivity'>
<Slider
min={1}
max={5}
step={1}
min={0.5}
max={4}
step={null}
value={ptCtx.rectRotateSensitivity}
onChange={handleSliderChange}
marks={marks}
Expand Down

0 comments on commit e15624f

Please sign in to comment.