From e5307ca1fb75dc99f5e067c3e0edaa82e62c862f Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 6 Feb 2017 18:17:34 +1100 Subject: [PATCH] Fix for bug where rotating / editing a selected item would remove it from screen - Added test to see if there was a currently-editing item Fixes: lp:1661866 https://bugs.launchpad.net/kicad/+bug/1661866 --- eeschema/hotkeys.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 7da7862018..743371ab4c 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -634,7 +634,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, if( hotKey == NULL ) return false; - bool itemInEdit = GetScreen()->GetCurItem() && GetScreen()->GetCurItem()->GetFlags(); + bool itemInEdit = m_drawItem && m_drawItem->InEditMode(); bool blocInProgress = GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK; @@ -689,7 +689,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, break; case HK_EDIT: - if( ! itemInEdit ) + if( !itemInEdit ) m_drawItem = LocateItemUsingCursor( aPosition ); if( m_drawItem ) @@ -729,7 +729,8 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, } else { - m_drawItem = LocateItemUsingCursor( aPosition ); + if( !itemInEdit ) + m_drawItem = LocateItemUsingCursor( aPosition ); if( m_drawItem ) {