!49147 [richEditor]修复手柄移动时变更选区导致振动问题

Merge pull request !49147 from zzc0127/handle
This commit is contained in:
openharmony_ci 2024-11-22 02:02:06 +00:00 committed by Gitee
commit ee6e44bdc3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -183,7 +183,6 @@ void RichEditorSelectOverlay::UpdateSelectorOnHandleMove(const OffsetF& handleOf
auto& textSelector = pattern->textSelector_;
auto currentHandleIndex = pattern->GetHandleIndex(Offset(handleOffset.GetX(), handleOffset.GetY()));
auto preHandleIndex = isFirst ? textSelector.baseOffset : textSelector.destinationOffset;
pattern->StartVibratorByIndexChange(currentHandleIndex, preHandleIndex);
pattern->SetCaretPosition(currentHandleIndex);
if (isFirst) {
pattern->HandleSelectionChange(currentHandleIndex, initSelector_.second);
@ -196,6 +195,8 @@ void RichEditorSelectOverlay::UpdateSelectorOnHandleMove(const OffsetF& handleOf
pattern->HandleSelectionChange(initSelector_.first, currentHandleIndex);
}
}
auto finalHandleIndex = isFirst ? textSelector.baseOffset : textSelector.destinationOffset;
pattern->StartVibratorByIndexChange(finalHandleIndex, preHandleIndex);
}
void RichEditorSelectOverlay::OnHandleMoveDone(const RectF& handleRect, bool isFirstHandle)