From 21e02d56c282fb4f078806c46772f412668143b8 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 18 Apr 2010 18:49:21 +0000 Subject: [PATCH] render characters on OSX one by one as fractional widths leads to errors otherwise git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/caret/caret.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/caret/caret.cpp b/samples/caret/caret.cpp index a1f025a653..596fa4b653 100644 --- a/samples/caret/caret.cpp +++ b/samples/caret/caret.cpp @@ -412,7 +412,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxPaintDC dc( this ); PrepareDC( dc ); dc.Clear(); - + dc.SetFont( m_font ); for ( int y = 0; y < m_yChars; y++ ) @@ -424,10 +424,17 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxChar ch = CharAt(x, y); if ( !ch ) ch = wxT(' '); +#ifdef __WXOSX__ + dc.DrawText(ch, m_xMargin + x * m_widthChar, + m_yMargin + y * m_heightChar ); +#else line += ch; +#endif } +#ifndef __WXOSX__ dc.DrawText( line, m_xMargin, m_yMargin + y * m_heightChar ); +#endif } } -- 2.45.2