improve comment cursor move

This commit is contained in:
hjlarry 2025-10-04 14:36:10 +08:00
parent 37ecd4a0bc
commit bf71300635
2 changed files with 3 additions and 7 deletions

View File

@ -4,12 +4,9 @@ import { useStore } from '../store'
import { ControlMode } from '../types'
import { Comment } from '@/app/components/base/icons/src/public/other'
type CommentCursorProps = {
mousePosition: { elementX: number; elementY: number }
}
export const CommentCursor: FC<CommentCursorProps> = memo(({ mousePosition }) => {
export const CommentCursor: FC = memo(() => {
const controlMode = useStore(s => s.controlMode)
const mousePosition = useStore(s => s.mousePosition)
if (controlMode !== ControlMode.Comment)
return null

View File

@ -202,7 +202,6 @@ export const Workflow: FC<WorkflowProps> = memo(({
} = useWorkflowComment()
const showUserComments = useStore(s => s.showUserComments)
const showUserCursors = useStore(s => s.showUserCursors)
const mousePosition = useStore(s => s.mousePosition)
const { t } = useTranslation()
eventEmitter?.useSubscription((v: any) => {
@ -442,7 +441,7 @@ export const Workflow: FC<WorkflowProps> = memo(({
)}
<LimitTips />
{controlMode === ControlMode.Comment && isMouseOverCanvas && (
<CommentCursor mousePosition={mousePosition} />
<CommentCursor />
)}
{pendingComment && (
<CommentInput