Skip to content

Commit

Permalink
Fixed a bug where only 1 word wrap variant can exist (#1058)
Browse files Browse the repository at this point in the history
* Fixed a bug where only 1 word wrap variant can exist

* Made the delimiters a string view
  • Loading branch information
SMJSGaming authored Aug 31, 2024
1 parent 444a8c1 commit d0eb881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion loader/src/ui/nodes/TextArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d0eb881

Please sign in to comment.