diff options
author | crupest <crupest@outlook.com> | 2020-03-01 22:32:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-01 22:32:58 +0800 |
commit | f23077eb0ddff77b7e114994f967189ea7607600 (patch) | |
tree | 9d27ccf8d721d40f8829ae2458e67a60eaaed25d /include/cru/platform/graph/text_layout.hpp | |
parent | 6e0e0e18cbeff6487160c84d71997575f6cccebd (diff) | |
download | cru-f23077eb0ddff77b7e114994f967189ea7607600.tar.gz cru-f23077eb0ddff77b7e114994f967189ea7607600.tar.bz2 cru-f23077eb0ddff77b7e114994f967189ea7607600.zip |
Complete hit test in text layout.
Diffstat (limited to 'include/cru/platform/graph/text_layout.hpp')
-rw-r--r-- | include/cru/platform/graph/text_layout.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cru/platform/graph/text_layout.hpp b/include/cru/platform/graph/text_layout.hpp index 4f6e81e1..d1cfb44b 100644 --- a/include/cru/platform/graph/text_layout.hpp +++ b/include/cru/platform/graph/text_layout.hpp @@ -8,6 +8,12 @@ namespace cru::platform::graph { struct IFont; +struct TextHitTestResult { + int position; + bool trailing; + bool insideText; +}; + struct ITextLayout : virtual IGraphResource { virtual std::string GetText() = 0; virtual void SetText(std::string new_text) = 0; @@ -20,5 +26,7 @@ struct ITextLayout : virtual IGraphResource { virtual Rect GetTextBounds() = 0; virtual std::vector<Rect> TextRangeRect(const TextRange& text_range) = 0; + virtual Point TextSingleRect(int position, bool trailing) = 0; + virtual TextHitTestResult HitTest(const Point& point) = 0; }; } // namespace cru::platform::graph |