diff options
author | crupest <crupest@outlook.com> | 2024-02-08 15:12:29 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-02-08 15:12:29 +0800 |
commit | f3af6c7e5b46f4209a4981e5d7be217368f40b15 (patch) | |
tree | e932747ad91a718abb667a6170b21f1521a04d1e /include/cru/ui/render/TextRenderObject.h | |
parent | bfe23251a54b036abef9241ba0994c9e51db25b2 (diff) | |
download | cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.tar.gz cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.tar.bz2 cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.zip |
Get rid of GSL.
Diffstat (limited to 'include/cru/ui/render/TextRenderObject.h')
-rw-r--r-- | include/cru/ui/render/TextRenderObject.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/cru/ui/render/TextRenderObject.h b/include/cru/ui/render/TextRenderObject.h index f12ac72f..0cb3623d 100644 --- a/include/cru/ui/render/TextRenderObject.h +++ b/include/cru/ui/render/TextRenderObject.h @@ -51,7 +51,7 @@ class CRU_UI_API TextRenderObject : public RenderObject { Index GetLineIndexFromCharIndex(Index char_index); float GetLineHeight(Index line_index); std::vector<Rect> TextRangeRect(const TextRange& text_range); - Rect TextSinglePoint(gsl::index position, bool trailing); + Rect TextSinglePoint(Index position, bool trailing); platform::graphics::TextHitTestResult TextHitTest(const Point& point); std::optional<TextRange> GetSelectionRange() const { @@ -70,8 +70,8 @@ class CRU_UI_API TextRenderObject : public RenderObject { // Caret position can be any value. When it is negative, 0 is used. When it // exceeds the size of the string, the size of the string is used. - gsl::index GetCaretPosition() const { return caret_position_; } - void SetCaretPosition(gsl::index position); + Index GetCaretPosition() const { return caret_position_; } + void SetCaretPosition(Index position); // Lefttop relative to content lefttop. Rect GetCaretRectInContent(); @@ -115,7 +115,7 @@ class CRU_UI_API TextRenderObject : public RenderObject { std::shared_ptr<platform::graphics::IBrush> selection_brush_; bool draw_caret_ = false; - gsl::index caret_position_ = 0; + Index caret_position_ = 0; std::shared_ptr<platform::graphics::IBrush> caret_brush_; float caret_width_ = default_caret_width; |