From 51e72ed9ba975947a04a63aac344706e0acf0999 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 6 May 2020 20:35:46 +0100 Subject: [PATCH] Finish the collect-attached-labels rewrite. Fixes https://gitlab.com/kicad/code/kicad/issues/4341 --- eeschema/tools/sch_move_tool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index f129a2e959..ef3158f0b5 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -528,6 +528,10 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_ITEM* aOriginalItem, wxPoint aPoi testLine->SetFlags( ENDPOINT | TEMP_SELECTED ); otherEnd = testLine->GetStartPoint(); } + else + { + break; + } // Since only one end is going to move, the movement vector of any labels attached // to it is scaled by the proportion of the line length the label is from the moving @@ -544,7 +548,7 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_ITEM* aOriginalItem, wxPoint aPoi if( !label->HasFlag( TEMP_SELECTED ) ) aList.push_back( label ); - double scale = GetLineLength( label->GetPosition(), aPoint ) / + double scale = GetLineLength( label->GetPosition(), otherEnd ) / GetLineLength( otherEnd, aPoint ); m_specialCaseLabels[label] = scale;