This commit is contained in:
dickelbeck 2008-03-06 01:46:13 +00:00
parent b58c2a0554
commit f966e8a437
1 changed files with 40 additions and 2 deletions

View File

@ -119,11 +119,49 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* Track )
current_net_code = Track->GetNet();
#if 0 && !defined(DEBUG)
#if 0
Track->Draw( DrawPanel, DC, GR_XOR );
#else
// just redraw the whole drawing so there are no XOR remnants at track intersections.
// redraw the area where the track was
// this rectangle is corrrect
EDA_Rect dirty = Track->GetBoundingBox();
D(printf( "dirty m_Pos=(%d, %d) m_Size=(%d, %d)\n",
dirty.m_Pos.x, dirty.m_Pos.y, dirty.m_Size.x, dirty.m_Size.y );)
int zoom = GetZoom();
wxPoint drwOrig = GetScreen()->m_DrawOrg;
dirty.m_Pos.x = (dirty.m_Pos.x - drwOrig.x) / zoom;
dirty.m_Pos.y = (dirty.m_Pos.y - drwOrig.y) / zoom;
dirty.m_Size.x = (dirty.m_Size.x - drwOrig.x) / zoom;
dirty.m_Size.y = (dirty.m_Size.y - drwOrig.y) / zoom;
D(printf( "dirty scaled zoom=%d m_Pos=(%d, %d) m_Size=(%d, %d) drwOrig=(%d, %d)\n",
zoom,
dirty.m_Pos.x, dirty.m_Pos.y, dirty.m_Size.x, dirty.m_Size.y,
drwOrig.x, drwOrig.y );)
// pass wxRect() via EDA_Rect::operator wxRect() overload
wxRect dirtyR = dirty;
D(printf( "dirtyR m_Pos=(%d, %d) m_Size=(%d, %d)\n",
dirtyR.x, dirtyR.y, dirtyR.width, dirtyR.height );)
/* The calculation for dirtyR is either wrong or the handling of the clipping
rect in OnPaint() is wrong. Enable this line instead of the Refresh() below,
then try deleting a track segment.
DrawPanel->RefreshRect( dirtyR, TRUE );
*/
DrawPanel->Refresh( TRUE );
#endif
SaveItemEfface( Track, 1 );