From 4d6f628a1fcf10656539bfc1a56fdd60d6ea277d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 18 Mar 2014 11:33:49 +0100 Subject: [PATCH] Minor fixes to zone drawing tool. --- pcbnew/tools/drawing_tool.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 03be29686b..67b2b607b1 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -970,10 +970,15 @@ int DRAWING_TOOL::drawZone( bool aKeepout ) if( numPoints > 0 ) // cancel the current zone { delete zone; + zone = NULL; m_controls->SetAutoPan( false ); if( direction45 ) + { preview.Remove( &line45 ); + direction45 = false; + } + preview.FreeItems(); updatePreview = true; @@ -1010,10 +1015,20 @@ int DRAWING_TOOL::drawZone( bool aKeepout ) zone = NULL; } else + { delete zone; + zone = NULL; + } numPoints = 0; m_controls->SetAutoPan( false ); + + if( direction45 ) + { + preview.Remove( &line45 ); + direction45 = false; + } + preview.FreeItems(); updatePreview = true; }