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 /include/cru/ui/render/text_render_object.hpp | |
parent | 47053829c322c43032244937cb63f9da178b852d (diff) | |
download | cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.gz cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.bz2 cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.zip |
...
Diffstat (limited to 'include/cru/ui/render/text_render_object.hpp')
-rw-r--r-- | include/cru/ui/render/text_render_object.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/cru/ui/render/text_render_object.hpp b/include/cru/ui/render/text_render_object.hpp index 5394ee0a..33d34f78 100644 --- a/include/cru/ui/render/text_render_object.hpp +++ b/include/cru/ui/render/text_render_object.hpp @@ -1,6 +1,8 @@ #pragma once #include "render_object.hpp" +#include "cru/platform/graph/text_layout.hpp" + #include <memory> #include <string> @@ -8,7 +10,6 @@ namespace cru::platform::graph { struct IBrush; struct IFont; -struct ITextLayout; } // namespace cru::platform::graph namespace cru::ui::render { @@ -34,6 +35,10 @@ class TextRenderObject : public RenderObject { std::shared_ptr<platform::graph::IFont> GetFont() const; void SetFont(std::shared_ptr<platform::graph::IFont> font); + std::vector<Rect> TextRangeRect(const TextRange& text_range); + Point TextSingleRect(int position, bool trailing); + platform::graph::TextHitTestResult TextHitTest(const Point& point); + std::optional<TextRange> GetSelectionRange() const { return selection_range_; } |