Fic bug #1475891 (Assertion failed when appending a board in pcbnew)
This commit is contained in:
parent
3e0334a972
commit
1885a924d3
|
@ -124,6 +124,8 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
|
||||||
void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||||
GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor )
|
GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor )
|
||||||
{
|
{
|
||||||
|
if( !aDC )
|
||||||
|
return;
|
||||||
|
|
||||||
int w = GetWidth();
|
int w = GetWidth();
|
||||||
int h = GetHeight();
|
int h = GetHeight();
|
||||||
|
@ -187,13 +189,14 @@ void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoin
|
||||||
|
|
||||||
block->SetMoveVector( wxPoint( 0, 0 ) );
|
block->SetMoveVector( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
if( aErase )
|
if( aErase && aDC )
|
||||||
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
||||||
|
|
||||||
block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() );
|
block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() );
|
||||||
block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() );
|
block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() );
|
||||||
|
|
||||||
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
if( aDC )
|
||||||
|
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
||||||
|
|
||||||
if( block->GetState() == STATE_BLOCK_INIT )
|
if( block->GetState() == STATE_BLOCK_INIT )
|
||||||
{
|
{
|
||||||
|
|
|
@ -275,7 +275,7 @@ public:
|
||||||
m_new_name( aNewName ),
|
m_new_name( aNewName ),
|
||||||
m_lib_candidate( aLibCandidate ) { }
|
m_lib_candidate( aLibCandidate ) { }
|
||||||
|
|
||||||
RESCUE_CASE_CANDIDATE() {}
|
RESCUE_CASE_CANDIDATE() { m_lib_candidate = NULL; }
|
||||||
|
|
||||||
virtual wxString GetRequestedName() const { return m_requested_name; }
|
virtual wxString GetRequestedName() const { return m_requested_name; }
|
||||||
virtual wxString GetNewName() const { return m_new_name; }
|
virtual wxString GetNewName() const { return m_new_name; }
|
||||||
|
|
|
@ -297,7 +297,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
cancelCmd = true;
|
cancelCmd = true;
|
||||||
|
|
||||||
// undraw block outline
|
// undraw block outline
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
if( DC )
|
||||||
|
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -326,7 +327,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
|
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
|
||||||
nextcmd = true;
|
nextcmd = true;
|
||||||
m_canvas->SetMouseCaptureCallback( drawMovingBlock );
|
m_canvas->SetMouseCaptureCallback( drawMovingBlock );
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
if( DC )
|
||||||
|
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_DELETE: // Delete
|
case BLOCK_DELETE: // Delete
|
||||||
|
|
Loading…
Reference in New Issue