mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
TextEditor: Fixed a bug updating the text holder size for single-line editors
This commit is contained in:
parent
c7d082e770
commit
a533e86044
1 changed files with 12 additions and 1 deletions
|
|
@ -681,6 +681,16 @@ struct TextEditor::Iterator
|
|||
return roundToInt (height);
|
||||
}
|
||||
|
||||
int getTextRight()
|
||||
{
|
||||
float maxWidth = 0.0f;
|
||||
|
||||
while (next())
|
||||
maxWidth = jmax (maxWidth, atomRight);
|
||||
|
||||
return roundToInt (maxWidth);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
int indexInText = 0;
|
||||
float lineY = 0, lineHeight = 0, maxDescent = 0;
|
||||
|
|
@ -1437,7 +1447,8 @@ void TextEditor::checkLayout()
|
|||
if (getWordWrapWidth() > 0)
|
||||
{
|
||||
auto textBottom = Iterator (*this).getTotalTextHeight() + topIndent;
|
||||
auto textRight = getMaximumTextWidth() + leftIndent + rightEdgeSpace;
|
||||
auto textRight = jmax (getMaximumTextWidth() + leftIndent + rightEdgeSpace,
|
||||
Iterator (*this).getTextRight());
|
||||
|
||||
textHolder->setSize (textRight, textBottom);
|
||||
viewport->setScrollBarsShown (scrollbarVisible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue