Right click gets a new object if the mouse has moved

Right click is a pointing operation combined with a request for the
context menu.  We need to highlight the user's intended object when they
have moved their mouse to a new element instead of showing the context
menu for the selected object.

However, in cases where the selection is difficult to make, it is
sometimes helpful to select the item first, then right-click.  In these
cases, we keep the selection where the mouse remains inside the selected
object's bounding box.
This commit is contained in:
Seth Hillbrand 2019-10-29 08:11:06 -07:00
parent 43768b71c0
commit 868ff5bb2c
2 changed files with 6 additions and 2 deletions

View File

@ -315,8 +315,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
bool selectionCancelled = false;
if( m_selection.Empty() )
if( m_selection.Empty() ||
!m_selection.GetBoundingBox().Contains( wxPoint( evt->Position() ) ) )
{
ClearSelection();
SelectPoint( evt->Position(), EE_COLLECTOR::AllItems, &selectionCancelled );
m_selection.SetIsHover( true );
}

View File

@ -214,8 +214,10 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
bool selectionCancelled = false;
if( m_selection.Empty() )
if( m_selection.Empty() ||
!m_selection.GetBoundingBox().Contains( wxPoint( evt->Position() ) ) )
{
ClearSelection();
selectPoint( evt->Position(), false, &selectionCancelled );
m_selection.SetIsHover( true );
}