mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
修复RTL模式下小眼睛与cancelButton的获焦框偏移的问题
Signed-off-by: wanjining <wanjining@huawei.com> Change-Id: I2c0926db96964687e62980f3d32b1e1c6ecc5759
This commit is contained in:
parent
ef994acc28
commit
2e7fcf9678
@ -7936,7 +7936,16 @@ void TextFieldPattern::GetIconPaintRect(const RefPtr<TextInputResponseArea>& res
|
||||
auto imageFrameNode = AceType::DynamicCast<FrameNode>(imageNode);
|
||||
CHECK_NULL_VOID(imageFrameNode);
|
||||
auto imageRect = imageFrameNode->GetGeometryNode()->GetFrameRect();
|
||||
RectF rect(stackRect.GetX(), stackRect.GetY(), imageRect.Width(), imageRect.Height());
|
||||
auto layoutProperty = GetLayoutProperty<TextFieldLayoutProperty>();
|
||||
CHECK_NULL_VOID(layoutProperty);
|
||||
auto isRTL = layoutProperty->GetNonAutoLayoutDirection() == TextDirection::RTL;
|
||||
RectF rect;
|
||||
if (isRTL) {
|
||||
rect = RectF(stackRect.GetX() + stackRect.Width() - imageRect.Width(),
|
||||
stackRect.GetY(), imageRect.Width(), imageRect.Height());
|
||||
} else {
|
||||
rect = RectF(stackRect.GetX(), stackRect.GetY(), imageRect.Width(), imageRect.Height());
|
||||
}
|
||||
paintRect.SetRect(rect);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user