diff options
author | crupest <crupest@outlook.com> | 2020-03-03 23:36:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-03 23:36:45 +0800 |
commit | 0dcf8e686b93cca54a424affe0455d0a97d6c2ef (patch) | |
tree | 744897a3b6a29f6142f1943dab5d9957e670919b /src/ui/render/text_render_object.cpp | |
parent | 47053829c322c43032244937cb63f9da178b852d (diff) | |
download | cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.gz cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.bz2 cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.zip |
...
Diffstat (limited to 'src/ui/render/text_render_object.cpp')
-rw-r--r-- | src/ui/render/text_render_object.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/render/text_render_object.cpp b/src/ui/render/text_render_object.cpp index 6048f731..d14a46e2 100644 --- a/src/ui/render/text_render_object.cpp +++ b/src/ui/render/text_render_object.cpp @@ -47,6 +47,19 @@ void TextRenderObject::SetFont(std::shared_ptr<platform::graph::IFont> font) { text_layout_->SetFont(std::move(font)); } +std::vector<Rect> TextRenderObject::TextRangeRect(const TextRange& text_range) { + return text_layout_->TextRangeRect(text_range); +} + +Point TextRenderObject::TextSingleRect(int position, bool trailing) { + return text_layout_->TextSingleRect(position, trailing); +} + +platform::graph::TextHitTestResult TextRenderObject::TextHitTest( + const Point& point) { + return text_layout_->HitTest(point); +} + void TextRenderObject::Draw(platform::graph::IPainter* painter) { platform::graph::util::WithTransform( painter, |