FIX:the last char in a new line didn't display

Change-Id: I0bc21764259d93277e16db02ece838fcfed0b657
This commit is contained in:
liz.li 2023-02-07 14:41:58 +08:00 committed by Lane.Wei
parent 407a863a6f
commit 6bfd1a4322

View file

@ -371,7 +371,7 @@ void NotificationManager::PopNotification::count_lines()
}
m_endlines.clear();
while (last_end < text.length() - 1)
while (last_end < text.length())
{
size_t next_hard_end = text.find_first_of('\n', last_end);
if (next_hard_end != std::string::npos && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset) {