1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

macOS: Fixed an issue restoring graphics state after drawing an AttributedString

This commit is contained in:
Tom Poole 2019-12-30 15:12:02 +00:00
parent 008f097e12
commit 1d2fc2ddd5
2 changed files with 16 additions and 11 deletions

View file

@ -222,6 +222,8 @@ void TextLayout::draw (Graphics& g, Rectangle<float> area) const
auto origin = justification.appliedToRectangle (Rectangle<float> (width, getHeight()), area).getPosition();
auto& context = g.getInternalContext();
context.saveState();
auto clip = context.getClipBounds();
auto clipTop = clip.getY() - origin.y;
auto clipBottom = clip.getBottom() - origin.y;
@ -257,6 +259,8 @@ void TextLayout::draw (Graphics& g, Rectangle<float> area) const
}
}
}
context.restoreState();
}
void TextLayout::createLayout (const AttributedString& text, float maxWidth)