Commit 69b19f51 authored by jean-pierre charras's avatar jean-pierre charras

Libedit: fix a bug (affects only multi parts per packages) after moving an item.

parent b98538ec
...@@ -673,8 +673,13 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) ...@@ -673,8 +673,13 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
if( DrawStruct == NULL ) if( DrawStruct == NULL )
{ {
// Find the schematic object to move under the cursor // For a drag or copy command, try to find first a component:
DrawStruct = SchematicGeneralLocateAndDisplay( false ); if( DrawStruct == NULL && HK_Descr->m_Idcommand != HK_MOVE_COMPONENT_OR_ITEM )
DrawStruct = LocateSmallestComponent( GetScreen() );
// If no component, find the schematic object to move/drag or copy under the cursor
if( DrawStruct == NULL )
DrawStruct = SchematicGeneralLocateAndDisplay( false );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
......
...@@ -326,8 +326,6 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& ...@@ -326,8 +326,6 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
if( aData ) if( aData )
text = *(wxString*)aData; text = *(wxString*)aData;
else if( InEditMode() )
text = GetFullText( m_Unit );
else else
text = m_Text; text = m_Text;
......
...@@ -242,7 +242,16 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -242,7 +242,16 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
BASE_SCREEN* Screen = panel->GetScreen(); BASE_SCREEN* Screen = panel->GetScreen();
item->SetEraseLastDrawItem( erase ); item->SetEraseLastDrawItem( erase );
item->Draw( panel, DC, Screen->GetCursorDrawPosition(), -1, g_XorMode, NULL, // if item is the reference field, we must add the current unit id
if( item->Type() == LIB_FIELD_T )
{
int unit = ((LIB_EDIT_FRAME*)panel->GetParent())->GetUnit();
wxString text = ((LIB_FIELD*)item)->GetFullText( unit );
item->Draw( panel, DC, Screen->GetCursorDrawPosition(), -1, g_XorMode, &text,
DefaultTransform );
}
else
item->Draw( panel, DC, Screen->GetCursorDrawPosition(), -1, g_XorMode, NULL,
DefaultTransform ); DefaultTransform );
} }
...@@ -254,9 +263,6 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC ) ...@@ -254,9 +263,6 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
SetCursor( wxCURSOR_HAND ); SetCursor( wxCURSOR_HAND );
if( m_drawItem->GetUnit() != m_unit )
m_drawItem->SetUnit( m_unit );
TempCopyComponent(); TempCopyComponent();
m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCursorDrawPosition() ); m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCursorDrawPosition() );
DrawPanel->ManageCurseur = RedrawWhileMovingCursor; DrawPanel->ManageCurseur = RedrawWhileMovingCursor;
......
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