Pcbnew: Footprint warps to mouse if drag invoked from RMB menu
CHANGED: If the user selected a footprint and then invoked drag from the RMB menu, the footprint would warp to the mouse center (if set in preferences) instead of the mouse warping to the footprint center. There was a call to 'WarpCursor' that was coming after the menu had been closed and the mouse had already warped to the footprint center. This made the footprint jump instead to the old mouse position. This MR removes the call to 'WarpMouse' and prevents the footprint from warping to the mouse. Fixes https://gitlab.com/kicad/code/kicad/issues/7680
This commit is contained in:
parent
92cc88f87c
commit
7ec46bc346
|
@ -865,14 +865,8 @@ void TOOL_MANAGER::DispatchContextMenu( const TOOL_EVENT& aEvent )
|
||||||
if( wxWindow* frame = dynamic_cast<wxWindow*>( m_frame ) )
|
if( wxWindow* frame = dynamic_cast<wxWindow*>( m_frame ) )
|
||||||
frame->PopupMenu( menu.get() );
|
frame->PopupMenu( menu.get() );
|
||||||
|
|
||||||
// Warp the cursor if a menu item was selected
|
// If a menu is cancelled then notify tool
|
||||||
if( menu->GetSelected() >= 0 )
|
if( menu->GetSelected() < 0 )
|
||||||
{
|
|
||||||
if( m_viewControls && m_warpMouseAfterContextMenu )
|
|
||||||
m_viewControls->WarpCursor( m_menuCursor, true, false );
|
|
||||||
}
|
|
||||||
// Otherwise notify the tool of a cancelled menu
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TOOL_EVENT evt( TC_COMMAND, TA_CHOICE_MENU_CHOICE, -1 );
|
TOOL_EVENT evt( TC_COMMAND, TA_CHOICE_MENU_CHOICE, -1 );
|
||||||
evt.SetHasPosition( false );
|
evt.SetHasPosition( false );
|
||||||
|
|
Loading…
Reference in New Issue