Loading share/drawpanel.cpp +113 −22 Original line number Original line Diff line number Diff line Loading @@ -220,9 +220,7 @@ wxPoint WinEDA_DrawPanel::CursorRealPosition( const wxPoint& ScreenPos ) * @param ScreenPos = absolute position in pixels * @param ScreenPos = absolute position in pixels */ */ { { wxPoint curpos; wxPoint curpos = GetScreen()->CursorRealPosition( ScreenPos ); curpos = GetScreen()->CursorRealPosition( ScreenPos ); return curpos; return curpos; } } Loading Loading @@ -445,7 +443,9 @@ void WinEDA_DrawPanel::SetBoundaryBox() GetViewStart( &org.x, &org.y ); GetViewStart( &org.x, &org.y ); GetScrollPixelsPerUnit( &ii, &jj ); GetScrollPixelsPerUnit( &ii, &jj ); org.x *= ii; org.y *= jj; org.x *= ii; org.y *= jj; Screen->m_StartVisu = org; Screen->m_StartVisu = org; m_ClipBox.SetOrigin( org ); m_ClipBox.SetOrigin( org ); Loading Loading @@ -484,12 +484,92 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC ) /***************************************************/ /***************************************************/ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) /***************************************************/ /***************************************************/ #if 1 // new code without multiple calls to ReDraw() { { wxPaintDC paintDC( this ); wxPaintDC paintDC( this ); EDA_Rect tmp; EDA_Rect tmp; wxRect PaintClipBox; wxRect PaintClipBox; wxPoint org; wxPoint org; PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; org = m_ClipBox.GetOrigin(); static int counter; wxRegion upd = GetUpdateRegion(); // get the update rect list ++counter; PaintClipBox = upd.GetBox(); #if 1 && defined(DEBUG) printf( "PaintClipBox[%d]=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height, org.x, org.y, m_ClipBox.m_Pos.x, m_ClipBox.m_Pos.y, m_ClipBox.m_Size.x, m_ClipBox.m_Size.y ); #endif PaintClipBox.x += org.x; PaintClipBox.y += org.y; #ifdef WX_ZOOM m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); m_ClipBox.m_Pos.y = PaintClipBox.y * GetZoom(); m_ClipBox.m_Size.x = PaintClipBox.width * GetZoom(); m_ClipBox.m_Size.y = PaintClipBox.height * GetZoom(); #else m_ClipBox.SetX( PaintClipBox.GetX() ); m_ClipBox.SetY( PaintClipBox.GetY() ); m_ClipBox.SetWidth( PaintClipBox.GetWidth() ); m_ClipBox.SetHeight( PaintClipBox.GetHeight() ); #endif #if 1 && defined(DEBUG) printf( "PaintClipBox[%d]=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height, org.x, org.y, m_ClipBox.m_Pos.x, m_ClipBox.m_Pos.y, m_ClipBox.m_Size.x, m_ClipBox.m_Size.y ); #endif PaintClipBox = m_ClipBox; wxDCClipper* dcclip = new wxDCClipper( paintDC, PaintClipBox ); ReDraw( &paintDC, TRUE ); delete dcclip; m_ClipBox = tmp; event.Skip(); } #else // old code { wxPaintDC paintDC( this ); EDA_Rect tmp; wxRect PaintClipBox; wxPoint org; static int counter; ++counter; PrepareGraphicContext( &paintDC ); PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; tmp = m_ClipBox; Loading @@ -505,6 +585,15 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) PaintClipBox.x += org.x; PaintClipBox.x += org.x; PaintClipBox.y += org.y; PaintClipBox.y += org.y; #if 0 printf( "PaintClipBox[%d]=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height ); #endif #ifdef WX_ZOOM #ifdef WX_ZOOM m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); Loading @@ -531,6 +620,8 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) event.Skip(); event.Skip(); } } #endif /****************************************************/ /****************************************************/ void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) Loading Loading
share/drawpanel.cpp +113 −22 Original line number Original line Diff line number Diff line Loading @@ -220,9 +220,7 @@ wxPoint WinEDA_DrawPanel::CursorRealPosition( const wxPoint& ScreenPos ) * @param ScreenPos = absolute position in pixels * @param ScreenPos = absolute position in pixels */ */ { { wxPoint curpos; wxPoint curpos = GetScreen()->CursorRealPosition( ScreenPos ); curpos = GetScreen()->CursorRealPosition( ScreenPos ); return curpos; return curpos; } } Loading Loading @@ -445,7 +443,9 @@ void WinEDA_DrawPanel::SetBoundaryBox() GetViewStart( &org.x, &org.y ); GetViewStart( &org.x, &org.y ); GetScrollPixelsPerUnit( &ii, &jj ); GetScrollPixelsPerUnit( &ii, &jj ); org.x *= ii; org.y *= jj; org.x *= ii; org.y *= jj; Screen->m_StartVisu = org; Screen->m_StartVisu = org; m_ClipBox.SetOrigin( org ); m_ClipBox.SetOrigin( org ); Loading Loading @@ -484,12 +484,92 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC ) /***************************************************/ /***************************************************/ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) /***************************************************/ /***************************************************/ #if 1 // new code without multiple calls to ReDraw() { { wxPaintDC paintDC( this ); wxPaintDC paintDC( this ); EDA_Rect tmp; EDA_Rect tmp; wxRect PaintClipBox; wxRect PaintClipBox; wxPoint org; wxPoint org; PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; org = m_ClipBox.GetOrigin(); static int counter; wxRegion upd = GetUpdateRegion(); // get the update rect list ++counter; PaintClipBox = upd.GetBox(); #if 1 && defined(DEBUG) printf( "PaintClipBox[%d]=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height, org.x, org.y, m_ClipBox.m_Pos.x, m_ClipBox.m_Pos.y, m_ClipBox.m_Size.x, m_ClipBox.m_Size.y ); #endif PaintClipBox.x += org.x; PaintClipBox.y += org.y; #ifdef WX_ZOOM m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); m_ClipBox.m_Pos.y = PaintClipBox.y * GetZoom(); m_ClipBox.m_Size.x = PaintClipBox.width * GetZoom(); m_ClipBox.m_Size.y = PaintClipBox.height * GetZoom(); #else m_ClipBox.SetX( PaintClipBox.GetX() ); m_ClipBox.SetY( PaintClipBox.GetY() ); m_ClipBox.SetWidth( PaintClipBox.GetWidth() ); m_ClipBox.SetHeight( PaintClipBox.GetHeight() ); #endif #if 1 && defined(DEBUG) printf( "PaintClipBox[%d]=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height, org.x, org.y, m_ClipBox.m_Pos.x, m_ClipBox.m_Pos.y, m_ClipBox.m_Size.x, m_ClipBox.m_Size.y ); #endif PaintClipBox = m_ClipBox; wxDCClipper* dcclip = new wxDCClipper( paintDC, PaintClipBox ); ReDraw( &paintDC, TRUE ); delete dcclip; m_ClipBox = tmp; event.Skip(); } #else // old code { wxPaintDC paintDC( this ); EDA_Rect tmp; wxRect PaintClipBox; wxPoint org; static int counter; ++counter; PrepareGraphicContext( &paintDC ); PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; tmp = m_ClipBox; Loading @@ -505,6 +585,15 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) PaintClipBox.x += org.x; PaintClipBox.x += org.x; PaintClipBox.y += org.y; PaintClipBox.y += org.y; #if 0 printf( "PaintClipBox[%d]=(%d, %d, %d, %d)\n", counter, PaintClipBox.x, PaintClipBox.y, PaintClipBox.width, PaintClipBox.height ); #endif #ifdef WX_ZOOM #ifdef WX_ZOOM m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom(); Loading @@ -531,6 +620,8 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) event.Skip(); event.Skip(); } } #endif /****************************************************/ /****************************************************/ void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) Loading