mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix addFittedText overflowing the bounds when line spacing and height multiple is non-default
This commit is contained in:
parent
b9458fb240
commit
283ea12958
2 changed files with 6 additions and 1 deletions
|
|
@ -336,7 +336,10 @@ static auto createFittedText (const Font& f,
|
||||||
while (numLines < maximumLines)
|
while (numLines < maximumLines)
|
||||||
{
|
{
|
||||||
++numLines;
|
++numLines;
|
||||||
auto newFontHeight = height / (float) numLines;
|
|
||||||
|
const auto a = baseOptions.getAdditiveLineSpacing();
|
||||||
|
auto newFontHeight = ((height + a) / (float) numLines - a)
|
||||||
|
/ baseOptions.getLeading();
|
||||||
|
|
||||||
if (newFontHeight < font.getHeight())
|
if (newFontHeight < font.getHeight())
|
||||||
font.setHeight (jmax (8.0f, newFontHeight));
|
font.setHeight (jmax (8.0f, newFontHeight));
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,8 @@ private:
|
||||||
class JUCE_API GlyphArrangement final
|
class JUCE_API GlyphArrangement final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
using Options = GlyphArrangementOptions;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** Creates an empty arrangement. */
|
/** Creates an empty arrangement. */
|
||||||
GlyphArrangement();
|
GlyphArrangement();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue