Reset tools when clearing gerber draw layers

Fixes: lp:1744600
* https://bugs.launchpad.net/kicad/+bug/1744600
This commit is contained in:
Jon Evans 2018-01-21 21:27:56 -05:00 committed by Maciej Suminski
parent 81642dddd1
commit 5ea277d229
1 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#include <class_gerber_file_image_list.h>
#include <class_gerbview_layer_widget.h>
#include <view/view.h>
#include <tool/tool_manager.h>
bool GERBVIEW_FRAME::Clear_DrawLayers( bool query )
{
@ -50,6 +51,9 @@ bool GERBVIEW_FRAME::Clear_DrawLayers( bool query )
if( auto canvas = GetGalCanvas() )
{
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
canvas->GetView()->Clear();
}
@ -76,6 +80,9 @@ void GERBVIEW_FRAME::Erase_Current_DrawLayer( bool query )
SetCurItem( NULL );
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
GetImagesList()->DeleteImage( layer );
ReFillLayerWidget();