Commit 28d702f6 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Eeschema: fix a *very subtle* bug noticeable only in complex hierachies, for...

Eeschema: fix a *very subtle* bug noticeable only in complex hierachies, for multiple parts per package:
sometimes, the modified flag was set for these components just when switching from a sheet to an other sheet.
Pcbnew: fix Bug #1197414 (dragged track segments does not show clearance area)
parent 26bd37e0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@ void SCH_COMPONENT::SetUnit( int aUnit )
    }
}

void SCH_COMPONENT::UpdateUnit( int aUnit )
{
    m_unit = aUnit;
}


void SCH_COMPONENT::SetConvert( int aConvert )
{
+15 −0
Original line number Diff line number Diff line
@@ -130,8 +130,23 @@ public:

    int GetUnit() const { return m_unit; }

    /**
     * change the unit id to aUnit
     * has maening only for multiple parts per package
     * Also set the modified flag bit
     * @param aUnit = the new unit Id
     */
    void SetUnit( int aUnit );

    /**
     * change the unit id to aUnit
     * has maening only for multiple parts per package
     * Do not change the modified flag bit, and should be used when
     * change is not due to an edition command
     * @param aUnit = the new unit Id
     */
    void UpdateUnit( int aUnit );

    int GetConvert() const { return m_convert; }

    void SetConvert( int aConvert );
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
        {
            SCH_COMPONENT* component = (SCH_COMPONENT*) t;
            component->GetField( REFERENCE )->SetText( component->GetRef( this ) );
            component->SetUnit( component->GetUnitSelection( this ) );
            component->UpdateUnit( component->GetUnitSelection( this ) );
        }

        t = t->Next();
+1 −0
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ void UndrawAndMarkSegmentsToDrag( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )

        track->Draw( aCanvas, aDC, GR_XOR );
        track->SetState( IN_EDIT, false );
        track->SetFlags( IS_DRAGGED );

        if( g_DragSegmentList[ii].m_Flag & STARTPOINT )
            track->SetFlags( STARTPOINT );
+2 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
                pt_segm = g_DragSegmentList[ii].m_Track;
                pt_segm->Draw( Panel, DC, GR_XOR );
                pt_segm->SetState( IN_EDIT, false );
                pt_segm->ClearFlags();
                g_DragSegmentList[ii].RestoreInitialValues();
                pt_segm->Draw( Panel, DC, GR_OR );
            }
@@ -405,6 +406,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, wxDC* aDC, bool aDoNotRecreat
    {
        TRACK * track = g_DragSegmentList[ii].m_Track;
        track->SetState( IN_EDIT, false );
        track->ClearFlags();

        if( aDC )
            track->Draw( m_canvas, aDC, GR_OR );
Loading