From f90ca7408d226316594ebde91706e9c399229923 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 16 Nov 2018 21:02:45 +0100 Subject: [PATCH] Legacy canvas: fix missing code to draw block outline. Due to recent changes in legacy canvas code, when starting a block command, the block outline was not drawn in pcbnew and pl_editor during block definition. Fixes: lp:1803668 https://bugs.launchpad.net/kicad/+bug/1803668 --- common/legacy_wx/block.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/legacy_wx/block.cpp b/common/legacy_wx/block.cpp index fc85d7abb0..320e21f4e1 100644 --- a/common/legacy_wx/block.cpp +++ b/common/legacy_wx/block.cpp @@ -178,9 +178,16 @@ void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoin BLOCK_SELECTOR* block = &aPanel->GetScreen()->m_BlockLocate; block->SetMoveVector( wxPoint( 0, 0 ) ); + + if( aErase && aDC ) // Erase current outline + block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() ); + block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() ); block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() ); + if( aDC ) // Draw new outline + block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() ); + if( block->GetState() == STATE_BLOCK_INIT ) { if( block->GetWidth() || block->GetHeight() )