Fixed a bug where only 1 word wrap variant can exist (#1058)

* Fixed a bug where only 1 word wrap variant can exist

* Made the delimiters a string view
This commit is contained in:
SMJS 2024-08-31 12:27:38 +02:00 committed by GitHub
parent 444a8c198b
commit d0eb881ebc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,7 +209,7 @@ void SimpleTextArea::updateLinesNoWrap() {
void SimpleTextArea::updateLinesWordWrap(bool spaceWrap) {
this->charIteration([this, spaceWrap](CCLabelBMFont* line, const char c, const float top) {
static const std::string delimiters(spaceWrap ? " " : " `~!@#$%^&*()-_=+[{}];:'\",<.>/?\\|");
const std::string_view delimiters(spaceWrap ? " " : " `~!@#$%^&*()-_=+[{}];:'\",<.>/?\\|");
if (delimiters.find(c) == std::string_view::npos) {
const std::string& text = line->getString();