Use original event position if it's available.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15623
(cherry picked from commit e962615407
)
This commit is contained in:
parent
4eb9281f4d
commit
f1376396c2
|
@ -239,7 +239,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
||||||
setCursor();
|
setCursor();
|
||||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||||
grid.SetUseGrid( view.GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
|
grid.SetUseGrid( view.GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
|
||||||
const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr );
|
VECTOR2I cursorPos = evt->HasPosition() ? evt->Position() : controls.GetMousePosition();
|
||||||
|
cursorPos = grid.BestSnapAnchor( cursorPos, nullptr );
|
||||||
controls.ForceCursorPosition( true, cursorPos );
|
controls.ForceCursorPosition( true, cursorPos );
|
||||||
|
|
||||||
if( evt->IsCancelInteractive() )
|
if( evt->IsCancelInteractive() )
|
||||||
|
|
Loading…
Reference in New Issue