7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 12:59:34 +00:00

Refresh preview after rotate/flip/mirror during move.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19561
This commit is contained in:
Jeff Young 2025-03-14 13:10:14 +00:00
parent 313232c9f3
commit 3c32f4d31d
2 changed files with 27 additions and 2 deletions

View File

@ -1943,6 +1943,12 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
}
}
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
return 0;
}
@ -2065,7 +2071,10 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
}
// Restore the old reference so any mouse dragging that occurs doesn't make the selection jump
@ -2229,7 +2238,10 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
return 0;
}
@ -2304,7 +2316,10 @@ int EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
return 0;
}
@ -2385,7 +2400,10 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
// Restore the old reference so any mouse dragging that occurs doesn't make the selection jump
// to this now invalid reference
@ -2810,7 +2828,10 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( m_dragging )
{
m_toolMgr->PostAction( PCB_ACTIONS::updateLocalRatsnest, VECTOR2I() );
m_toolMgr->PostAction( PCB_ACTIONS::refreshPreview );
}
}
return 0;

View File

@ -465,12 +465,16 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
if( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) )
eatFirstMouseUp = false;
if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT )
if( evt->IsAction( &PCB_ACTIONS::move )
|| evt->IsMotion()
|| evt->IsDrag( BUT_LEFT )
|| evt->IsAction( &ACTIONS::refreshPreview )
|| evt->IsAction( &PCB_ACTIONS::moveWithReference )
|| evt->IsAction( &PCB_ACTIONS::moveIndividually ) )
{
if( m_dragging && evt->Category() == TC_MOUSE )
if( m_dragging && ( evt->IsMotion()
|| evt->IsDrag( BUT_LEFT )
|| evt->IsAction( &ACTIONS::refreshPreview ) ) )
{
bool redraw3D = false;