fix 切换成维吾尔语后showCounter的位置不对

Signed-off-by: zhoukechen <zhoukechen2@huawei.com>
Change-Id: I3cb1bc3e197470a41e9b74168eeff840daa4a0aa
This commit is contained in:
zhoukechen 2024-09-19 21:28:39 +08:00
parent 5383d1ed49
commit e201fc60e9
2 changed files with 7 additions and 23 deletions

View File

@ -419,27 +419,11 @@ TextAlign TextFieldLayoutAlgorithm::GetCounterNodeAlignment(LayoutWrapper* layou
RefPtr<LayoutProperty> property = frameNode->GetLayoutProperty();
CHECK_NULL_RETURN(property, TextAlign::END);
TextDirection layoutDirection = property->GetLayoutDirection();
TextAlign textAlign = TextAlign::END;
switch (layoutDirection) {
case TextDirection::LTR:
case TextDirection::AUTO:
if (isRTL) {
textAlign = TextAlign::START;
} else {
textAlign = TextAlign::END;
}
break;
case TextDirection::RTL:
if (isRTL) {
textAlign = TextAlign::END;
} else {
textAlign = TextAlign::START;
}
break;
default:
break;
if ((layoutDirection == TextDirection::RTL && !isRTL) ||
(layoutDirection == TextDirection::LTR && isRTL)) {
return TextAlign::START;
}
return textAlign;
return TextAlign::END;
}
void TextFieldLayoutAlgorithm::UpdateCounterNode(

View File

@ -1211,7 +1211,7 @@ void TextFieldPattern::HandleBlurEvent()
auto host = GetHost();
CHECK_NULL_VOID(host);
TAG_LOGI(AceLogTag::ACE_TEXT_FIELD, "TextField %{public}d OnBlur", host->GetId());
auto context = PipelineContext::GetCurrentContextSafely();
auto context = host->GetContextRefPtr();
CHECK_NULL_VOID(context);
UpdateBlurReason();
auto textFieldManager = DynamicCast<TextFieldManagerNG>(context->GetTextFieldManager());
@ -3308,10 +3308,10 @@ void TextFieldPattern::RestoreDefaultMouseState()
#ifdef WINDOW_SCENE_SUPPORTED
windowId = static_cast<int32_t>(GetSCBSystemWindowId());
#endif
auto pipeline = PipelineContext::GetCurrentContextSafely();
CHECK_NULL_VOID(pipeline);
auto host = GetHost();
CHECK_NULL_VOID(host);
auto pipeline = host->GetContextRefPtr();
CHECK_NULL_VOID(pipeline);
auto id = host->GetId();
pipeline->SetMouseStyleHoldNode(id);
pipeline->ChangeMouseStyle(id, MouseFormat::DEFAULT, windowId);