From 69c73b0ebc5d1c6f901b334505b0ee1929b03298 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 13:50:27 +0200 Subject: [PATCH] Updated POINT_EDITOR to handle module edges. --- pcbnew/tools/point_editor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index fa9ae8b029..64ad775a06 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -36,7 +36,7 @@ #include "point_editor.h" #include -#include +#include #include #include #include @@ -77,6 +77,7 @@ public: switch( aItem->Type() ) { case PCB_LINE_T: + case PCB_MODULE_EDGE_T: { const DRAWSEGMENT* segment = static_cast( aItem ); @@ -354,6 +355,7 @@ void POINT_EDITOR::updateItem() const switch( item->Type() ) { case PCB_LINE_T: + case PCB_MODULE_EDGE_T: { DRAWSEGMENT* segment = static_cast( item ); switch( segment->GetShape() ) @@ -428,6 +430,10 @@ void POINT_EDITOR::updateItem() const break; } + // Update relative coordinates for module edges + if( EDGE_MODULE* edge = dyn_cast( item ) ) + edge->SetLocalCoord(); + break; } @@ -521,6 +527,7 @@ void POINT_EDITOR::updatePoints() const switch( item->Type() ) { case PCB_LINE_T: + case PCB_MODULE_EDGE_T: { const DRAWSEGMENT* segment = static_cast( item ); { @@ -610,6 +617,7 @@ EDIT_POINT POINT_EDITOR::get45DegConstrainer() const switch( item->Type() ) { case PCB_LINE_T: + case PCB_MODULE_EDGE_T: { const DRAWSEGMENT* segment = static_cast( item ); { @@ -700,7 +708,7 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint ) outline->InsertCorner( nearestIdx, nearestPoint.x, nearestPoint.y ); } - else if( item->Type() == PCB_LINE_T ) + else if( item->Type() == PCB_LINE_T || item->Type() == PCB_MODULE_EDGE_T ) { getEditFrame()->OnModify(); getEditFrame()->SaveCopyInUndoList( selection.items, UR_CHANGED );