From 15908f0a43e14de933d24623a4efc0b93781ded0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:40:18 +0000 Subject: [PATCH] If string are empty, DoGetTextExtent should not return descent by a random value git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/dcclient.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 9de4aa580f..e6986d1630 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1660,6 +1660,13 @@ void wxWindowDCImpl::DoGetTextExtent( const wxString &string, wxCoord *width, wx { if (width) (*width) = 0; if (height) (*height) = 0; + + //empty string should also make sure the descent and leading is zero. + if (descent) + { + (*descent) = 0; + } + if (externalLeading) (*externalLeading) = 0; return; }