Commit f3cfea95 authored by Marco Serantoni's avatar Marco Serantoni

[MacOSX] Fixing crash when changing module text properties - bug #1230090

parent 578ecc6f
...@@ -183,11 +183,13 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) ...@@ -183,11 +183,13 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
if ( m_module) if ( m_module)
m_parent->SaveCopyInUndoList( m_module, UR_CHANGED ); m_parent->SaveCopyInUndoList( m_module, UR_CHANGED );
#ifndef USE_WX_OVERLAY
if( m_dc ) //Erase old text on screen if( m_dc ) //Erase old text on screen
{ {
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR, m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) ); (m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
} }
#endif
m_currentText->SetText( m_Name->GetValue() ); m_currentText->SetText( m_Name->GetValue() );
m_currentText->SetItalic( m_Style->GetSelection() == 1 ); m_currentText->SetItalic( m_Style->GetSelection() == 1 );
...@@ -238,11 +240,15 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) ...@@ -238,11 +240,15 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
m_currentText->SetDrawCoord(); m_currentText->SetDrawCoord();
#ifndef USE_WX_OVERLAY
if( m_dc ) // Display new text if( m_dc ) // Display new text
{ {
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR, m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) ); (m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
} }
#else
m_parent->Refresh();
#endif
m_parent->OnModify(); m_parent->OnModify();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment