mirror of https://github.com/aseprite/aseprite.git
Use gfx::RectF instead of gfx::Rect for text line bounds
This commit is contained in:
parent
fb4f4d9fa6
commit
0dc4bc9aa7
|
@ -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 {};
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue