do use the font in DoGetTextExtent()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -218,14 +218,13 @@ void wxMetafileDC::DoGetTextExtent(const wxString& string,
|
|||||||
if (!fontToUse)
|
if (!fontToUse)
|
||||||
fontToUse = &m_font;
|
fontToUse = &m_font;
|
||||||
|
|
||||||
HDC dc = GetDC(NULL);
|
ScreenHDC dc;
|
||||||
|
SelectInHDC selFont(dc, GetHfontOf(*fontToUse));
|
||||||
|
|
||||||
SIZE sizeRect;
|
SIZE sizeRect;
|
||||||
TEXTMETRIC tm;
|
TEXTMETRIC tm;
|
||||||
::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
|
::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
|
||||||
GetTextMetrics(dc, &tm);
|
::GetTextMetrics(dc, &tm);
|
||||||
|
|
||||||
ReleaseDC(NULL, dc);
|
|
||||||
|
|
||||||
if ( x )
|
if ( x )
|
||||||
*x = sizeRect.cx;
|
*x = sizeRect.cx;
|
||||||
|
Reference in New Issue
Block a user