aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/text_render_object.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-03 23:36:45 +0800
committercrupest <crupest@outlook.com>2020-03-03 23:36:45 +0800
commit0dcf8e686b93cca54a424affe0455d0a97d6c2ef (patch)
tree744897a3b6a29f6142f1943dab5d9957e670919b /include/cru/ui/render/text_render_object.hpp
parent47053829c322c43032244937cb63f9da178b852d (diff)
downloadcru-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.hpp7
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_;
}