Positioned text correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
418d4918a2
commit
9f05ea2173
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user