eeschema-gal: don't warp cursor back to mouse when using hotkey to emulate a mouse click

Fixes: lp:1797273
* https://bugs.launchpad.net/kicad/+bug/1797273
This commit is contained in:
Tomasz Włostowski 2018-10-17 23:24:35 +02:00
parent 441cac9f1b
commit 12567c7500
2 changed files with 4 additions and 3 deletions

View File

@ -480,10 +480,11 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
} }
else if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK ) else if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK )
{ {
OnLeftClick( aDC, aPosition ); auto pos = GetCrossHairPosition();
OnLeftClick( aDC, pos );
if( hotKey->m_Idcommand == HK_LEFT_DCLICK ) if( hotKey->m_Idcommand == HK_LEFT_DCLICK )
OnLeftDClick( aDC, aPosition ); OnLeftDClick( aDC, pos );
} }
break; break;

View File

@ -676,7 +676,7 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
// Compute the cursor position in drawing units. Also known as logical units to wxDC. // Compute the cursor position in drawing units. Also known as logical units to wxDC.
//pos = wxPoint( DC.DeviceToLogicalX( pos.x ), DC.DeviceToLogicalY( pos.y ) ); //pos = wxPoint( DC.DeviceToLogicalX( pos.x ), DC.DeviceToLogicalY( pos.y ) );
auto p = GetViewControls()->GetMousePosition(); auto p = GetViewControls()->GetCursorPosition( false );
wxPoint pos ((int)p.x, (int)p.y); wxPoint pos ((int)p.x, (int)p.y);