|
|
|
@@ -232,7 +232,7 @@ void TextLayout::createLayout (const AttributedString& text, float maxWidth) |
|
|
|
if (! createNativeLayout (text))
|
|
|
|
createStandardLayout (text);
|
|
|
|
|
|
|
|
recalculateWidth();
|
|
|
|
recalculateWidth (text);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
@@ -600,17 +600,16 @@ void TextLayout::createStandardLayout (const AttributedString& text) |
|
|
|
l.createLayout (text, *this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextLayout::recalculateWidth()
|
|
|
|
void TextLayout::recalculateWidth (const AttributedString& text)
|
|
|
|
{
|
|
|
|
if (lines.size() > 0)
|
|
|
|
if (lines.size() > 0 && text.getReadingDirection() != AttributedString::rightToLeft)
|
|
|
|
{
|
|
|
|
Range<float> range (lines.getFirst()->getLineBoundsX());
|
|
|
|
|
|
|
|
int i;
|
|
|
|
for (i = lines.size(); --i > 0;)
|
|
|
|
for (int i = lines.size(); --i > 0;)
|
|
|
|
range = range.getUnionWith (lines.getUnchecked(i)->getLineBoundsX());
|
|
|
|
|
|
|
|
for (i = lines.size(); --i >= 0;)
|
|
|
|
for (int i = lines.size(); --i >= 0;)
|
|
|
|
lines.getUnchecked(i)->lineOrigin.x -= range.getStart();
|
|
|
|
|
|
|
|
width = range.getLength();
|
|
|
|
|