From: Francesco Montorsi Date: Fri, 20 Feb 2009 16:38:48 +0000 (+0000) Subject: fix a couple of drawing defects X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9425b04cfd3d7a385b0ea47be862d7a0f88c6389 fix a couple of drawing defects git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 261e81fc69..c6e7d0d2de 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -833,7 +833,7 @@ void MyImageDialog::OnPaint(wxPaintEvent& WXUNUSED(evt)) // paint a sort of progress bar with a 10px border: dc.SetBrush(*wxRED_BRUSH); - dc.DrawRectangle(10,10, 10+m_nCurrentProgress*(GUITHREAD_BMP_SIZE-20)/100,30); + dc.DrawRectangle(10,10, m_nCurrentProgress*(sz.GetWidth()-20)/100,30); dc.SetTextForeground(*wxBLUE); dc.DrawText(wxString::Format("%d%%", m_nCurrentProgress), (sz.GetWidth()-dc.GetCharWidth()*2)/2, @@ -998,7 +998,7 @@ wxThread::ExitCode MyGUIThread::Entry() // notify the dialog that another piece of our masterpiece is complete: wxThreadEvent event( wxEVT_COMMAND_THREAD, GUITHREAD_EVENT ); - event.SetInt(i); + event.SetInt(i+1); wxQueueEvent( m_dlg, event.Clone() ); // give the main thread the time to refresh before we lock the GUI mutex again