1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:37:43 +00:00

LibGfx+AK: Make text elision work with multi-byte characters

This was causing WindowServer and Taskbar to crash sometimes when the
stars aligned and we tried cutting off a string ending with "..." right
on top of an emoji. :^)
This commit is contained in:
Andreas Kling 2020-12-28 23:51:24 +01:00
parent 9af33e2e4b
commit 13594b7146
4 changed files with 17 additions and 4 deletions

View file

@ -65,7 +65,7 @@ Utf8CodepointIterator Utf8View::end() const
return { end_ptr(), 0 };
}
int Utf8View::byte_offset_of(const Utf8CodepointIterator& it) const
size_t Utf8View::byte_offset_of(const Utf8CodepointIterator& it) const
{
ASSERT(it.m_ptr >= begin_ptr());
ASSERT(it.m_ptr <= end_ptr());