diff --git a/change_log.txt b/change_log.txt index 924e36fbe2..3a58e16dbd 100644 --- a/change_log.txt +++ b/change_log.txt @@ -26,6 +26,7 @@ email address. PostDirtyRect(). * void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track ) now redraws the screen after a net deletion. + * eeschema/dialog_find.cpp: set the initial keyboard focus to the text control 2008-Mar-10 UPDATE Jean-Pierre Charras diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index fa7ba46de9..496e27456c 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -42,6 +42,20 @@ void DbgDisplayTrackInfos( TRACK* track ) #endif +/** + * Function ShowClearance + * tests to see if the clearance border is drawn on the given track. + * @return bool - true if should draw clearance, else false. + */ +static bool ShowClearance( const TRACK* aTrack ) +{ + // maybe return true for (for tracks and vias, not for zone segments + return ( DisplayOpt.DisplayTrackIsol && ( aTrack->GetLayer() <= LAST_COPPER_LAYER ) + && ( aTrack->Type() == TYPETRACK || aTrack->Type() == TYPEVIA) ); +} + + + /**********************************************************/ TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) : BOARD_ITEM( StructFather, idtype ) @@ -242,6 +256,12 @@ EDA_Rect TRACK::GetBoundingBox() const xmin = MIN( m_Start.x, m_End.x ); } + if( ShowClearance( this ) ) + { + // + 1 is for the clearance line itself. + radius += g_DesignSettings.m_TrackClearence + 1; + } + ymax += radius; xmax += radius; @@ -249,7 +269,9 @@ EDA_Rect TRACK::GetBoundingBox() const xmin -= radius; // return a rectangle which is [pos,dim) in nature. therefore the +1 - return EDA_Rect( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) ); + EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) ); + + return ret; } @@ -783,8 +805,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ) } /* Shows clearance (for tracks and vias, not for zone segments */ - if( DisplayOpt.DisplayTrackIsol && ( m_Layer <= LAST_COPPER_LAYER ) - && ( Type() == TYPETRACK || Type() == TYPEVIA) ) + if( ShowClearance( this ) ) { GRCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, m_End.x, m_End.y, diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index 8516ec5245..1f699fa9cd 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -168,14 +168,9 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track ) if( segm->GetNet() != net_code_delete ) break; - // This works ok, but sometimes leaves stuff on screen. I think - // the erase rectangle is not large enough always. - // DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); + DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); } - // Do this instead of PostDirtyRect() for now - DrawPanel->Refresh( TRUE ); - SaveItemEfface( trackList, ii ); GetScreen()->SetModify(); test_1_net_connexion( DC, net_code_delete ); diff --git a/share/drawpanel.cpp b/share/drawpanel.cpp index 1a755f2e42..ca77381f2a 100644 --- a/share/drawpanel.cpp +++ b/share/drawpanel.cpp @@ -274,8 +274,9 @@ void WinEDA_DrawPanel::PostDirtyRect( EDA_Rect aRect ) // Ensure the rectangle is large enough after truncations. // The pcb units have finer granularity than the pixels, so it can happen // that the rectangle is not large enough for the erase portion. - aRect.m_Size.x += 1; - aRect.m_Size.y += 1; + + aRect.m_Size.x += 2; // += 1 is not enough! + aRect.m_Size.y += 2; // pass wxRect() via EDA_Rect::operator wxRect() overload RefreshRect( aRect, TRUE );