1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

TextLayout: Fix getStringBounds of empty strings

This commit is contained in:
無常 2024-10-24 22:57:06 +08:00 committed by Tom Poole
parent 3c38adcc03
commit a784d5776b

View file

@ -275,6 +275,10 @@ public:
{
TextLayout layout;
layout.createLayout (string, std::numeric_limits<float>::max());
if (layout.getNumLines() == 0)
return {};
return layout.getLine (0).getLineBounds();
}