Index: ps/trunk/source/gui/CGUIText.cpp =================================================================== --- ps/trunk/source/gui/CGUIText.cpp +++ ps/trunk/source/gui/CGUIText.cpp @@ -68,6 +68,7 @@ CStrIntern font(fontW.ToUTF8()); float y = bufferZone; // drawing pointer + float lineWidth = 0.f; int from = 0; bool firstLine = true; // Necessary because text in the first line is shorter @@ -97,12 +98,17 @@ posLastImage = std::max(posLastImage, i); + lineWidth += feedback.m_Size.Width; + prelimLineHeight = std::max(prelimLineHeight, feedback.m_Size.Height); // If width is 0, then there's no word-wrapping, disable NewLine. - if (((width != 0 && (feedback.m_Size.Width + 2 * bufferZone > width || feedback.m_NewLine)) || i == static_cast(string.m_Words.size()) - 2) && - ProcessLine(pGUI, string, font, pObject, images, align, prelimLineHeight, width, bufferZone, firstLine, y, i, from)) - return; + if ((width != 0 && from != i && (lineWidth + 2 * bufferZone > width || feedback.m_NewLine)) || i == static_cast(string.m_Words.size()) - 2) + { + if (ProcessLine(pGUI, string, font, pObject, images, align, prelimLineHeight, width, bufferZone, firstLine, y, i, from)) + return; + lineWidth = 0.f; + } } } @@ -332,7 +338,7 @@ int& from) { bool done = false; - float x = 0.f; + float x = dx; for (int j = tempFrom; j <= i; ++j) { @@ -350,7 +356,7 @@ for (STextCall& tc : feedback2.m_TextCalls) { - tc.m_Pos = CVector2D(dx + x + xPointer, y); + tc.m_Pos = CVector2D(x + xPointer, y); xPointer += tc.m_Size.Width;