From 9f05ea217301c66ab58bd484ad4fab4f9d259170 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 12 Feb 2002 14:56:31 +0000 Subject: [PATCH] Positioned text correctly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/dcclient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 53a0311a55..93746522bd 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1232,6 +1232,10 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) x = XLOG2DEV(x); y = YLOG2DEV(y); + XCharStruct overall_return; + int direction, slen, ascent, descent; + (void)XTextExtents((XFontStruct*) xfont, (char*) (const char*) text, slen, &direction, + &ascent, &descent, &overall_return); #if 0 wxCoord width = gdk_string_width( font, text.mbc_str() ); wxCoord height = font->ascent + font->descent; @@ -1248,7 +1252,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0)) { XDrawString( (Display*) m_display, (Window) m_window, - (GC) m_textGC, x, y, text.c_str(), text.Len() ); + (GC) m_textGC, x, y + ascent, text.c_str(), text.Len() ); wxLogDebug("Drawing text %s at %d, %d", text.c_str(), x, y); } -- 2.45.2