Fix mouse warping and dialog placement for layer switcher.
Fixes https://gitlab.com/kicad/code/kicad/issues/2607
This commit is contained in:
parent
b8e97bb6b6
commit
d7ddc62d7e
|
@ -750,13 +750,16 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
|
|||
// ask the user for a target layer
|
||||
if( selectLayer )
|
||||
{
|
||||
wxPoint dlgPosition = wxGetMousePosition();
|
||||
wxPoint endPoint = (wxPoint) view()->ToScreen( m_endSnapPoint );
|
||||
endPoint = frame()->GetCanvas()->ClientToScreen( endPoint );
|
||||
|
||||
controls()->WarpCursor( endPoint );
|
||||
|
||||
targetLayer = frame()->SelectLayer( static_cast<PCB_LAYER_ID>( currentLayer ),
|
||||
LSET::AllNonCuMask(), dlgPosition );
|
||||
LSET::AllNonCuMask(), endPoint );
|
||||
|
||||
// Reset the cursor to the position where the event occurred
|
||||
controls()->SetCursorPosition( aEvent.HasPosition() ? aEvent.Position() : dlgPosition );
|
||||
// Reset the cursor to the end of the track
|
||||
controls()->SetCursorPosition( m_endSnapPoint );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue