mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +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:
parent
9af33e2e4b
commit
13594b7146
4 changed files with 17 additions and 4 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue