From 56336fdafeea43096009c3f135c4f9d06bf33ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Thu, 30 Nov 2017 17:21:51 +0100 Subject: [PATCH] POINT_EDITOR: migrate to ZONE_FILLER class --- pcbnew/tools/point_editor.cpp | 15 ++++++++------- pcbnew/tools/point_editor.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index fa225f508b..b7c00108d4 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -45,6 +45,8 @@ using namespace std::placeholders; #include #include +#include "zone_filler.h" + // Point editor TOOL_ACTION PCB_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner", AS_GLOBAL, 0, @@ -215,7 +217,7 @@ private: POINT_EDITOR::POINT_EDITOR() : - TOOL_INTERACTIVE( "pcbnew.PointEditor" ), m_selectionTool( NULL ), m_editedPoint( NULL ), + PCB_TOOL( "pcbnew.PointEditor" ), m_selectionTool( NULL ), m_editedPoint( NULL ), m_original( VECTOR2I( 0, 0 ) ), m_altConstrainer( VECTOR2I( 0, 0 ) ) { } @@ -559,21 +561,20 @@ void POINT_EDITOR::updateItem() const } -void POINT_EDITOR::finishItem() const +void POINT_EDITOR::finishItem() { - EDA_ITEM* item = m_editPoints->GetParent(); - + auto item = m_editPoints->GetParent(); if( !item ) return; if( item->Type() == PCB_ZONE_AREA_T ) { - ZONE_CONTAINER* zone = static_cast( item ); + auto zone = static_cast( item ); if( zone->IsFilled() ) { - getEditFrame()->Fill_Zone( zone ); -// zone->GetBoard()->GetRatsnest()->Recalculate( zone->GetNetCode() ); + ZONE_FILLER filler( board() ); + filler.Fill( { zone } ); } } } diff --git a/pcbnew/tools/point_editor.h b/pcbnew/tools/point_editor.h index 24fb8c0987..4363520777 100644 --- a/pcbnew/tools/point_editor.h +++ b/pcbnew/tools/point_editor.h @@ -38,7 +38,7 @@ class SELECTION_TOOL; * * Tool that displays edit points allowing to modify items by dragging the points. */ -class POINT_EDITOR : public TOOL_INTERACTIVE +class POINT_EDITOR : public PCB_TOOL { public: POINT_EDITOR(); @@ -82,7 +82,7 @@ private: void updateItem() const; ///> Applies the last changes to the edited item. - void finishItem() const; + void finishItem(); ///> Updates edit points with item's points. void updatePoints();