From 886dc48cc42aee6dea94364d5a9f12ceb8982d85 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 26 Mar 2018 23:30:56 +0200 Subject: [PATCH] Point Editor: reset the pointer to the modified point as it becomes invalid Fixes: lp:1759024 * https://bugs.launchpad.net/kicad/+bug/1759024 --- pcbnew/tools/point_editor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index b453924390..286d0a8e09 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -99,8 +99,8 @@ private: points->AddBreak(); } - // Lines have to be added after creating edit points, - // as they use EDIT_POINT references + // Lines have to be added after creating edit points, + // as they use EDIT_POINT references for( int i = 0; i < cornersCount - 1; ++i ) { if( points->IsContourEnd( i ) ) @@ -117,7 +117,7 @@ private: std::bind( &KIGFX::GAL::GetGridPoint, aGal, _1 ) ) ); } - // The last missing line, connecting the last and the first polygon point + // The last missing line, connecting the last and the first polygon point points->AddLine( points->Point( cornersCount - 1 ), points->Point( points->GetContourStartIdx( cornersCount - 1 ) ) ); @@ -667,6 +667,7 @@ void POINT_EDITOR::updatePoints() if( m_editPoints->PointsSize() != (unsigned) outline->TotalVertices() ) { getView()->Remove( m_editPoints.get() ); + m_editedPoint = nullptr; m_editPoints = EDIT_POINTS_FACTORY::Make( item, getView()->GetGAL() ); getView()->Add( m_editPoints.get() ); }