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
This commit is contained in:
parent
f96628f5c2
commit
a5dcc192dc
|
@ -660,7 +660,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
if( hotKey == NULL )
|
if( hotKey == NULL )
|
||||||
return false;
|
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;
|
bool blocInProgress = GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK;
|
||||||
|
|
||||||
|
@ -715,7 +715,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HK_EDIT:
|
case HK_EDIT:
|
||||||
if( ! itemInEdit )
|
if( !itemInEdit )
|
||||||
m_drawItem = LocateItemUsingCursor( aPosition );
|
m_drawItem = LocateItemUsingCursor( aPosition );
|
||||||
|
|
||||||
if( m_drawItem )
|
if( m_drawItem )
|
||||||
|
@ -755,7 +755,8 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_drawItem = LocateItemUsingCursor( aPosition );
|
if ( !itemInEdit )
|
||||||
|
m_drawItem = LocateItemUsingCursor( aPosition );
|
||||||
|
|
||||||
if( m_drawItem )
|
if( m_drawItem )
|
||||||
{
|
{
|
||||||
|
@ -815,13 +816,17 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HK_MIRROR_Y: // Mirror Y
|
case HK_MIRROR_Y: // Mirror Y
|
||||||
m_drawItem = LocateItemUsingCursor( aPosition );
|
if( !itemInEdit )
|
||||||
|
m_drawItem = LocateItemUsingCursor( aPosition );
|
||||||
|
|
||||||
cmd.SetId( ID_LIBEDIT_MIRROR_Y );
|
cmd.SetId( ID_LIBEDIT_MIRROR_Y );
|
||||||
GetEventHandler()->ProcessEvent( cmd );
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HK_MIRROR_X: // Mirror X
|
case HK_MIRROR_X: // Mirror X
|
||||||
m_drawItem = LocateItemUsingCursor( aPosition );
|
if( !itemInEdit )
|
||||||
|
m_drawItem = LocateItemUsingCursor( aPosition );
|
||||||
|
|
||||||
cmd.SetId( ID_LIBEDIT_MIRROR_X );
|
cmd.SetId( ID_LIBEDIT_MIRROR_X );
|
||||||
GetEventHandler()->ProcessEvent( cmd );
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue