From 6cf3b937fc3a8d9ce5620cab958b953d2805cf04 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 10 Jan 2015 10:28:09 +0100 Subject: [PATCH] Fix Eeschema drag Bug #1408661 --- eeschema/hotkeys.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 58458b954d..809a34ab82 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -348,8 +349,6 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); - cmd.SetEventObject( this ); - SCH_SCREEN* screen = GetScreen(); // itemInEdit == false means no item currently edited. We can ask for editing a new item @@ -393,12 +392,19 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, break; case HK_LEFT_CLICK: - OnLeftClick( aDC, aPosition ); - break; - case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events - OnLeftClick( aDC, aPosition ); - OnLeftDClick( aDC, aPosition ); + if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE ) + { + GetCanvas()->SetAutoPanRequest( false ); + HandleBlockPlace( aDC ); + } + else if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK ) + { + OnLeftClick( aDC, aPosition ); + + if( hotKey->m_Idcommand == HK_LEFT_DCLICK ) + OnLeftDClick( aDC, aPosition ); + } break; case HK_ZOOM_IN: