mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +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)
|
||||
{
|
||||
++numLines;
|
||||
auto newFontHeight = height / (float) numLines;
|
||||
|
||||
const auto a = baseOptions.getAdditiveLineSpacing();
|
||||
auto newFontHeight = ((height + a) / (float) numLines - a)
|
||||
/ baseOptions.getLeading();
|
||||
|
||||
if (newFontHeight < font.getHeight())
|
||||
font.setHeight (jmax (8.0f, newFontHeight));
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ private:
|
|||
class JUCE_API GlyphArrangement final
|
||||
{
|
||||
public:
|
||||
using Options = GlyphArrangementOptions;
|
||||
|
||||
//==============================================================================
|
||||
/** Creates an empty arrangement. */
|
||||
GlyphArrangement();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue