From eb3976df2957d5a9539c3abc58e8686a258c9d51 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Fri, 2 Nov 2007 20:17:35 +0000 Subject: [PATCH] fixed track delete bug --- pcbnew/hotkeys.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 240020439c..237ba2bce3 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -314,13 +314,19 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, // don't let backspace delete modules!! if( DrawStruct && (DrawStruct->Type() == TYPETRACK || DrawStruct->Type() == TYPEVIA) ) + { Delete_Segment( DC, (TRACK*) DrawStruct ); + SetCurItem(NULL); + } GetScreen()->SetModify(); } else if( GetCurItem()->Type() == TYPETRACK ) { // 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(); } } @@ -581,8 +587,10 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct ) } else if( GetCurItem()->Type() == TYPETRACK ) { - SetCurItem( - Delete_Segment( DC, (TRACK*) GetCurItem() ) ); + // simple lines for debugger: + TRACK* track = (TRACK*) GetCurItem(); + track = Delete_Segment( DC, track ); + SetCurItem( track ); GetScreen()->SetModify(); return TRUE; }