Return descent from Cairo GetTextExtent() even for empty strings
This method still needs to return the correct descent in this case. Fixes MeasuringTextTestCase::LeadingAndDescent() unit test failure with GTK+ 3.
This commit is contained in:
parent
643071fc77
commit
3b76e590d4
@ -2644,7 +2644,10 @@ void wxCairoContext::GetTextExtent( const wxString &str, wxDouble *width, wxDoub
|
||||
if ( externalLeading )
|
||||
*externalLeading = 0;
|
||||
|
||||
if ( str.empty())
|
||||
// We can skip computing the string width and height if it is empty, but
|
||||
// not its descent and/or external leading, which still needs to be
|
||||
// returned even for an empty string.
|
||||
if ( str.empty() && !descent && !externalLeading )
|
||||
return;
|
||||
|
||||
if ( ((wxCairoFontData*)m_font.GetRefData())->Apply((wxCairoContext*)this) )
|
||||
|
Loading…
Reference in New Issue
Block a user