inline适配镜像模式,文字方向为RTL时候留白移到左边

Signed-off-by: zhoukechen <zhoukechen2@huawei.com>
Change-Id: I977900da6b87b6477c8db080ab1caea43bec4276
This commit is contained in:
zhoukechen 2024-08-09 12:24:12 +08:00
parent 7ec1495e26
commit adfb146bfa

View File

@ -6066,8 +6066,14 @@ void TextFieldPattern::ApplyInlineTheme()
BorderColorProperty inlineBorderColor;
inlineBorderColor.SetColor(theme->GetInlineBorderColor());
renderContext->UpdateBorderColor(inlineBorderColor);
layoutProperty->UpdatePadding({ CalcLength(0.0f), CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f),
CalcLength(0.0f) });
if (layoutProperty->GetNonAutoLayoutDirection() == TextDirection::RTL) {
layoutProperty->UpdatePadding({ CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f), CalcLength(0.0f),
CalcLength(0.0f) });
} else {
layoutProperty->UpdatePadding({ CalcLength(0.0f), CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f),
CalcLength(0.0f) });
}
ProcessInnerPadding();
ProcessInlinePaddingAndMargin();
}