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:
parent
fbb592034f
commit
af35baccf5
2 changed files with 5 additions and 3 deletions
|
|
@ -273,7 +273,8 @@ void Graphics::drawSingleLineText (const String& text, const int startX, const i
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::drawMultiLineText (const String& text, const int startX,
|
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()
|
if (text.isNotEmpty()
|
||||||
&& startX < context.getClipBounds().getRight())
|
&& startX < context.getClipBounds().getRight())
|
||||||
|
|
@ -281,7 +282,7 @@ void Graphics::drawMultiLineText (const String& text, const int startX,
|
||||||
GlyphArrangement arr;
|
GlyphArrangement arr;
|
||||||
arr.addJustifiedText (context.getFont(), text,
|
arr.addJustifiedText (context.getFont(), text,
|
||||||
(float) startX, (float) baselineY, (float) maximumLineWidth,
|
(float) startX, (float) baselineY, (float) maximumLineWidth,
|
||||||
Justification::left);
|
justification);
|
||||||
arr.draw (*this);
|
arr.draw (*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void drawMultiLineText (const String& text,
|
void drawMultiLineText (const String& text,
|
||||||
int startX, int baselineY,
|
int startX, int baselineY,
|
||||||
int maximumLineWidth) const;
|
int maximumLineWidth,
|
||||||
|
Justification justification = Justification::left) const;
|
||||||
|
|
||||||
/** Draws a line of text within a specified rectangle.
|
/** Draws a line of text within a specified rectangle.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue