mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for software text layout colour of single-character strings.
This commit is contained in:
parent
0cc6fb9356
commit
349d3d423f
2 changed files with 5 additions and 5 deletions
|
|
@ -525,15 +525,17 @@ namespace TextLayoutHelpers
|
|||
}
|
||||
}
|
||||
|
||||
if ((i > 0 && newFontAndColour != lastFontAndColour) || i == stringLength - 1)
|
||||
if (i > 0 && newFontAndColour != lastFontAndColour)
|
||||
{
|
||||
runAttributes.add (RunAttribute (lastFontAndColour,
|
||||
Range<int> (rangeStart, (i < stringLength - 1) ? i : (i + 1))));
|
||||
runAttributes.add (RunAttribute (lastFontAndColour, Range<int> (rangeStart, i)));
|
||||
rangeStart = i;
|
||||
}
|
||||
|
||||
lastFontAndColour = newFontAndColour;
|
||||
}
|
||||
|
||||
if (rangeStart < stringLength)
|
||||
runAttributes.add (RunAttribute (lastFontAndColour, Range<int> (rangeStart, stringLength)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < runAttributes.size(); ++i)
|
||||
|
|
|
|||
|
|
@ -91,8 +91,6 @@ public:
|
|||
const float rightClip, const float x, const int y,
|
||||
const int lineH, const float characterWidth) const
|
||||
{
|
||||
Colour lastColour (0x00000001);
|
||||
|
||||
AttributedString as;
|
||||
as.setJustification (Justification::centredLeft);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue