Undo newline when the word position is already at the start of the line.

This commit is contained in:
Bartosz Taudul
2026-01-10 15:10:49 +01:00
parent ec2ac9f227
commit a04b0e515a

View File

@@ -152,8 +152,10 @@ bool PrintTextWrapped( const char* text, const char* end )
auto fwLen = ImGui::CalcTextSize( text, firstWord ).x;
if( fwLen > left )
{
const auto prev = left;
ImGui::NewLine();
left = ImGui::GetContentRegionAvail().x;
if( left == prev ) ImGui::SameLine( 0, 0 );
}
auto endLine = ImGui::GetFont()->CalcWordWrapPosition( fontSize, text, end, left );