Commit eb3976df authored by dickelbeck's avatar dickelbeck

fixed track delete bug

parent f72c53e8
...@@ -314,13 +314,19 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -314,13 +314,19 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
// don't let backspace delete modules!! // don't let backspace delete modules!!
if( DrawStruct && (DrawStruct->Type() == TYPETRACK if( DrawStruct && (DrawStruct->Type() == TYPETRACK
|| DrawStruct->Type() == TYPEVIA) ) || DrawStruct->Type() == TYPEVIA) )
{
Delete_Segment( DC, (TRACK*) DrawStruct ); Delete_Segment( DC, (TRACK*) DrawStruct );
SetCurItem(NULL);
}
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
else if( GetCurItem()->Type() == TYPETRACK ) else if( GetCurItem()->Type() == TYPETRACK )
{ {
// then an element is being edited - remove the last segment. // then an element is being edited - remove the last segment.
SetCurItem( Delete_Segment( DC, (TRACK*) GetCurItem() ) ); // simple lines for debugger:
TRACK* track = (TRACK*) GetCurItem() ;
track = Delete_Segment( DC, track );
SetCurItem( track );
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
} }
...@@ -581,8 +587,10 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct ) ...@@ -581,8 +587,10 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
} }
else if( GetCurItem()->Type() == TYPETRACK ) else if( GetCurItem()->Type() == TYPETRACK )
{ {
SetCurItem( // simple lines for debugger:
Delete_Segment( DC, (TRACK*) GetCurItem() ) ); TRACK* track = (TRACK*) GetCurItem();
track = Delete_Segment( DC, track );
SetCurItem( track );
GetScreen()->SetModify(); GetScreen()->SetModify();
return TRUE; 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