Commit 8bfdd040 authored by charras's avatar charras

Use dirty rectangle when deleting a footprint

parent c5b42440
......@@ -1039,6 +1039,17 @@ void MODULE::SetRectangleExinscrit()
}
/**
* Function GetBoundingBox
* returns the bounding box of this Footprint
*/
EDA_Rect MODULE::GetBoundingBox()
{
SetRectangleExinscrit();
return m_RealBoundaryBox;
}
/*******************************************************/
void MODULE::Display_Infos( WinEDA_DrawFrame* frame )
/*******************************************************/
......
......@@ -84,6 +84,11 @@ public:
void SetRectangleExinscrit(); /* mise a jour du rect d'encadrement
* et de la surface en coord reelles */
/**
* Function GetBoundingBox
* returns the bounding box of this Footprint
*/
EDA_Rect GetBoundingBox();
/**
* Function GetPosition
......
......@@ -262,10 +262,12 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
/**************************************************************/
/*
* Commande Delete Module :
* Suppression d'une empreinte
* les pointeurs divers sont mis a jour
/**
* Function Delete Module
* Remove a footprint from m_Modules linked list and put it in undelete buffer
* The net rastenes and pad list are recalcualed
* @param module = footprint to delete
* @param DC = currentDevice Context. if NULL: do not redraw new ratsnets and dirty rectange
*/
{
EDA_BaseStruct* PtBack, * PtNext;
......@@ -288,14 +290,12 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
m_CurrentScreen->SetModify();
/* Erase rastnest if needed */
/* Erase rastnest if needed
* Dirty rectangle is not used here because usually using a XOR draw mode gives good results (very few artefacts) for ratsnest
*/
if( g_Show_Ratsnest )
DrawGeneralRatsnest( DC );
/* Effacement du module a l'ecran */
if( DC )
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
/* Suppression du chainage */
PtBack = module->Pback;
PtNext = module->Pnext;
......@@ -316,6 +316,9 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
m_Pcb->m_Status_Pcb = 0;
build_liste_pads();
ReCompile_Ratsnest_After_Changes( DC );
// redraw the area where the module was
if ( DC )
DrawPanel->PostDirtyRect( module->GetBoundingBox() );
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment