diff --git a/src/ui/textedit.cpp b/src/ui/textedit.cpp index 2213bb6d4..21af66c8a 100644 --- a/src/ui/textedit.cpp +++ b/src/ui/textedit.cpp @@ -843,7 +843,7 @@ void TextEdit::Line::insertText(int pos, const std::string& str) text.insert(utfSize[pos - 1].end, str); } -gfx::Rect TextEdit::Line::getBounds(const int glyph) const +gfx::RectF TextEdit::Line::getBounds(const int glyph) const { int advance = 0; gfx::Rect result; @@ -857,7 +857,7 @@ gfx::Rect TextEdit::Line::getBounds(const int glyph) const return result; } -gfx::Rect TextEdit::Line::getBounds(int startGlyph, int endGlyph) const +gfx::RectF TextEdit::Line::getBounds(const int startGlyph, const int endGlyph) const { if (startGlyph == endGlyph) return {}; diff --git a/src/ui/textedit.h b/src/ui/textedit.h index 78d80f93d..8512ff9be 100644 --- a/src/ui/textedit.h +++ b/src/ui/textedit.h @@ -62,10 +62,10 @@ private: // Insert text into this line based on a caret position, taking into account utf8 size. void insertText(int pos, const std::string& str); - gfx::Rect getBounds(int glyph) const; + gfx::RectF getBounds(int glyph) const; // Get the screen size between the start and end glyph positions. - gfx::Rect getBounds(int startGlyph, int endGlyph) const; + gfx::RectF getBounds(int startGlyph, int endGlyph) const; }; struct Caret {