Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4004,7 +4004,14 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
}

// Allow wrapping after punctuation.
inside_word = (c != '.' && c != ',' && c != ';' && c != '!' && c != '?' && c != '\"');
unsigned int next_c = (unsigned int)*next_s;
bool current_is_punctuation = (c == '.' || c == ',' || c == ';' || c == '!' || c == '?' || c == '\"');
bool next_is_punctuation = (next_c == '.' || next_c == ',' || next_c == ';' || next_c == '!' || next_c == '?' || next_c == '\"');
if (current_is_punctuation && !next_is_punctuation) {
inside_word = false;
} else {
inside_word = true;
}
}

// We ignore blank width at the end of the line (they can be skipped)
Expand Down