|
From: Emilien K. <cur...@us...> - 2005-01-11 13:46:10
|
Update of /cvsroot/wxdevcenter/StdPlugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29769/src Modified Files: BitmapDocView.cpp Log Message: Vérification du rectangle de mise à jour pour éviter les plantages Index: BitmapDocView.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/src/BitmapDocView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BitmapDocView.cpp 10 Jan 2005 15:38:57 -0000 1.8 --- BitmapDocView.cpp 11 Jan 2005 13:45:55 -0000 1.9 *************** *** 64,67 **** --- 64,75 ---- } + void BitmapDocument::UpdateAllViews(wxDevCenter::View *pSender, unsigned int nUpdateCode, wxRect* pRect) + { + if(pRect!=NULL) + pRect->Intersect(wxRect(0, 0, m_Bmp.GetWidth(), m_Bmp.GetHeight())); + + Document::UpdateAllViews(pSender, nUpdateCode, (void*)pRect); + } + // Fixe la couleur d'un pixel. void BitmapDocument::SetPixel(wxPoint pt, wxColour col) *************** *** 453,466 **** { wxRect r = *((wxRect*)pUpdateInfo); ! bmp = GetDocument()->GetBitmap().GetSubBitmap(r); ! { // Local wxMemoryDC ! wxMemoryDC dc; ! dc.SelectObject(m_pBitmapCtrl->Bitmap()); ! dc.DrawBitmap(bmp, r.x, r.y, false); } - - m_pBitmapCtrl->Refresh(); - } } --- 461,476 ---- { wxRect r = *((wxRect*)pUpdateInfo); ! if(r.width!=0 && r.height!=0) ! { ! bmp = GetDocument()->GetBitmap().GetSubBitmap(r); ! { // Local wxMemoryDC ! wxMemoryDC dc; ! dc.SelectObject(m_pBitmapCtrl->Bitmap()); ! dc.DrawBitmap(bmp, r.x, r.y, false); ! } ! ! m_pBitmapCtrl->Refresh(); } } } |