From 3c4514540172059c453bca529b1258ea8df45ae1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 9 Feb 2024 10:19:26 +0000 Subject: [PATCH] Set move flags at beginning of move. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16891 --- eeschema/tools/sch_move_tool.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index 5020ff9979..4f61088d3f 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -606,11 +606,13 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm } else { - aCommit->Modify( (SCH_ITEM*) item, m_frame->GetScreen() ); + aCommit->Modify( item, m_frame->GetScreen() ); } - SCH_ITEM* schItem = (SCH_ITEM*) item; - schItem->SetStoredPos( schItem->GetPosition() ); + item->SetFlags( IS_MOVING ); + + if( SCH_ITEM* schItem = dynamic_cast( item ) ) + schItem->SetStoredPos( schItem->GetPosition() ); } // Set up the starting position and move/drag offset