Warp cursor back to creation point after new-text dailog.

Also fixes same issue for new zones.

Fixes: lp:1802532
* https://bugs.launchpad.net/kicad/+bug/1802532
This commit is contained in:
Jeff Young 2018-11-11 13:09:02 +00:00
parent 6789103961
commit befc504734
2 changed files with 6 additions and 0 deletions

View File

@ -376,6 +376,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
{
if( !text )
{
m_controls->ForceCursorPosition( true, m_controls->GetCursorPosition() );
PCB_LAYER_ID layer = m_frame->GetActiveLayer();
// Init the new item attributes
@ -432,6 +433,8 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
if( text == NULL )
continue;
m_controls->WarpCursor( text->GetPosition(), true );
m_controls->ForceCursorPosition( false );
m_controls->CaptureCursor( true );
m_controls->SetAutoPan( true );

View File

@ -57,6 +57,7 @@ std::unique_ptr<ZONE_CONTAINER> ZONE_CREATE_HELPER::createNewZone( bool aKeepout
{
auto& frame = *m_tool.getEditFrame<PCB_BASE_EDIT_FRAME>();
auto& board = *m_tool.getModel<BOARD>();
KIGFX::VIEW_CONTROLS* controls = m_tool.GetManager()->GetViewControls();
// Get the current default settings for zones
ZONE_SETTINGS zoneInfo = frame.GetZoneSettings();
@ -83,6 +84,8 @@ std::unique_ptr<ZONE_CONTAINER> ZONE_CREATE_HELPER::createNewZone( bool aKeepout
if( dialogResult == wxID_CANCEL )
return nullptr;
controls->WarpCursor( controls->GetCursorPosition(), true );
}
auto newZone = std::make_unique<ZONE_CONTAINER>( &board );