fix(Notification): some languages don't make use of spaces(#3316)

This commit is contained in:
sch-lda 2024-07-09 23:23:59 +08:00 committed by GitHub
parent 05aadfe98e
commit 8bae9f5b54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ namespace big
fadeEnd.Value.w *= alpha;
int j = 0;
int prevSpace = 0;
int prevSpace = -1;
float total_size = 0.f;
std::vector<std::string> split_points;
@ -43,10 +43,19 @@ namespace big
}
else if (size.x >= 330.f)
{
total_size = total_size + size.y;
split_points.push_back(message.substr(j, prevSpace - j));
j = prevSpace + 1;
i = prevSpace;
if (prevSpace != -1)
{
total_size = total_size + size.y;
split_points.push_back(message.substr(j, prevSpace - j));
j = prevSpace + 1;
i = prevSpace;
}
else
{
total_size = total_size + size.y;
split_points.push_back(message.substr(j, i - j));
j = i;
}
}
}