From aefad04995ca39dcb723cd73d7e9a55cf20980c5 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 4 Jun 2010 20:16:13 +0200 Subject: [PATCH] Pcbnew: fixed unwanted mouse cursor move when using the t hotkey --- pcbnew/edit.cpp | 2 +- pcbnew/hotkeys.cpp | 4 +++- pcbnew/modules.cpp | 3 --- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index f2c6190cab..3e0065e282 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -582,7 +582,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) g_Drag_Pistes_On = true; case ID_POPUP_PCB_MOVE_MODULE_REQUEST: - // If the current Item is a pad, text module ...: Get its parent if( GetCurItem()->Type() != TYPE_MODULE ) SetCurItem( GetCurItem()->GetParent() ); @@ -591,6 +590,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) g_Drag_Pistes_On = false; break; } + GetScreen()->m_Curseur = ((MODULE*) GetCurItem())->m_Pos; DrawPanel->MouseToCursorSchema(); StartMove_Module( (MODULE*) GetCurItem(), &dc ); break; diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 2112afe75c..067ca18d2d 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -423,7 +423,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct if( ItemFree ) { wxCommandEvent evt; - evt.SetId( ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST ); + evt.SetId( ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST ); Process_Special_Functions( evt ); } break; @@ -657,6 +657,8 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct // fall through case HK_MOVE_FOOTPRINT: // Start move module + GetScreen()->m_Curseur = module->m_Pos; + DrawPanel->MouseToCursorSchema(); StartMove_Module( module, DC ); break; } diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 97d61c5d7e..9d1fea96d9 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -100,9 +100,6 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC ) GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; module->m_Flags |= IS_MOVED; - GetScreen()->m_Curseur = module->m_Pos; - DrawPanel->MouseToCursorSchema(); - /* Show ratsnest. */ if( GetBoard()->IsElementVisible(RATSNEST_VISIBLE) ) DrawGeneralRatsnest( DC );