Commit c03abc0b authored by charras's avatar charras

eeschema, libedit: fixed a bug than crashes libedit when using the delete tool, on a left click.

parent 4b2f33a9
......@@ -539,6 +539,7 @@ EDA_Rect& EDA_Rect::Inflate( int aDelta )
*/
{
Inflate( aDelta, aDelta );
return *this;
}
/**************************************************/
......
......@@ -229,20 +229,11 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the path
* is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk++ )
{
if( fn.MakeRelativeTo( wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( list->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
......
......@@ -1247,7 +1247,7 @@ void LIB_SEGMENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 2, m_Width + 2 );
bBox.Inflate( m_Width + 2 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
......
......@@ -242,20 +242,11 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the path
* is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for ( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk ++ )
{
if( fn.MakeRelativeTo(wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
......
......@@ -123,7 +123,10 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
GetScreen()->m_Curseur );
}
if( DrawEntry == NULL )
{
DisplayCmpDoc();
break;
}
SaveCopyInUndoList( m_component );
if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE )
DeletePin( DC, m_component, (LIB_PIN*) DrawEntry );
......
......@@ -206,20 +206,11 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the
* path is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for ( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk ++ )
{
if( fn.MakeRelativeTo(wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
......
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