!42143 修复动态切换后手柄位置错误的问题

Merge pull request !42143 from LuckClover/DynamicHandleError
This commit is contained in:
openharmony_ci 2024-09-02 04:37:50 +00:00 committed by Gitee
commit 520bd448d5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 4 deletions

View File

@ -2760,6 +2760,7 @@ void TextPattern::ProcessOverlayAfterLayout()
showSelected_ = false;
CalculateHandleOffsetAndShowOverlay();
selectOverlay_->UpdateAllHandlesOffset();
selectOverlay_->UpdateViewPort();
}
}

View File

@ -485,10 +485,9 @@ bool TextFieldPattern::OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dir
} while (false);
}
auto textRect = textFieldLayoutAlgorithm->GetTextRect();
if (!needToRefreshSelectOverlay_ ||
(NearEqual(paragraphWidth, paragraphWidth_) && NearEqual(textRect.GetSize(), textRect_.GetSize()))) {
needToRefreshSelectOverlay_ = false;
}
auto isSameSizeMouseMenu = NearEqual(paragraphWidth, paragraphWidth_) &&
NearEqual(textRect.GetSize(), textRect_.GetSize()) && IsUsingMouse();
needToRefreshSelectOverlay_ = needToRefreshSelectOverlay_ && !isSameSizeMouseMenu;
paragraphWidth_ = paragraphWidth;
HandleContentSizeChange(textRect);
textRect_ = textRect;