1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Allowed different text justifications in drawMultiLineText

This commit is contained in:
James Hurst 2018-08-21 09:28:36 +01:00 committed by Tom Poole
parent fbb592034f
commit af35baccf5
2 changed files with 5 additions and 3 deletions

View file

@ -273,7 +273,8 @@ void Graphics::drawSingleLineText (const String& text, const int startX, const i
}
void Graphics::drawMultiLineText (const String& text, const int startX,
const int baselineY, const int maximumLineWidth) const
const int baselineY, const int maximumLineWidth,
Justification justification) const
{
if (text.isNotEmpty()
&& startX < context.getClipBounds().getRight())
@ -281,7 +282,7 @@ void Graphics::drawMultiLineText (const String& text, const int startX,
GlyphArrangement arr;
arr.addJustifiedText (context.getFont(), text,
(float) startX, (float) baselineY, (float) maximumLineWidth,
Justification::left);
justification);
arr.draw (*this);
}
}

View file

@ -145,7 +145,8 @@ public:
*/
void drawMultiLineText (const String& text,
int startX, int baselineY,
int maximumLineWidth) const;
int maximumLineWidth,
Justification justification = Justification::left) const;
/** Draws a line of text within a specified rectangle.