aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/text_render_object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/render/text_render_object.cpp')
-rw-r--r--src/ui/render/text_render_object.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ui/render/text_render_object.cpp b/src/ui/render/text_render_object.cpp
index 5022cc04..6048f731 100644
--- a/src/ui/render/text_render_object.cpp
+++ b/src/ui/render/text_render_object.cpp
@@ -64,14 +64,8 @@ void TextRenderObject::Draw(platform::graph::IPainter* painter) {
}
RenderObject* TextRenderObject::HitTest(const Point& point) {
- const auto margin = GetMargin();
- const auto size = GetSize();
- return Rect{margin.left, margin.top,
- std::max(size.width - margin.GetHorizontalTotal(), 0.0f),
- std::max(size.height - margin.GetVerticalTotal(), 0.0f)}
- .IsPointInside(point)
- ? this
- : nullptr;
+ const auto padding_rect = GetPaddingRect();
+ return padding_rect.IsPointInside(point) ? this : nullptr;
}
Size TextRenderObject::OnMeasureContent(const Size& available_size) {