mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
TextLayout: made the fallback layout algorithm make use of AttributedString::getLineSpacing()
This commit is contained in:
parent
5507ad4df7
commit
eb99390413
1 changed files with 4 additions and 5 deletions
|
|
@ -331,9 +331,8 @@ namespace TextLayoutHelpers
|
|||
Token& operator= (const Token&);
|
||||
};
|
||||
|
||||
class TokenList
|
||||
struct TokenList
|
||||
{
|
||||
public:
|
||||
TokenList() noexcept : totalLines (0) {}
|
||||
|
||||
void createLayout (const AttributedString& text, TextLayout& layout)
|
||||
|
|
@ -342,7 +341,7 @@ namespace TextLayoutHelpers
|
|||
layout.ensureStorageAllocated (totalLines);
|
||||
|
||||
addTextRuns (text);
|
||||
layoutRuns (layout.getWidth());
|
||||
layoutRuns (layout.getWidth(), text.getLineSpacing());
|
||||
|
||||
int charPosition = 0;
|
||||
int lineStartPosition = 0;
|
||||
|
|
@ -505,7 +504,7 @@ namespace TextLayoutHelpers
|
|||
tokens.add (new Token (currentString, font, colour, lastCharType == 2));
|
||||
}
|
||||
|
||||
void layoutRuns (const float maxWidth)
|
||||
void layoutRuns (const float maxWidth, const float extraLineSpacing)
|
||||
{
|
||||
float x = 0, y = 0, h = 0;
|
||||
int i;
|
||||
|
|
@ -516,7 +515,7 @@ namespace TextLayoutHelpers
|
|||
t.area.setPosition (x, y);
|
||||
t.line = totalLines;
|
||||
x += t.area.getWidth();
|
||||
h = jmax (h, t.area.getHeight());
|
||||
h = jmax (h, t.area.getHeight() + extraLineSpacing);
|
||||
|
||||
const Token* const nextTok = tokens[i + 1];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue