~sjr/kicad/wip-net-ties

« back to all changes in this revision

Viewing changes to eeschema/sch_screen.cpp

  • Committer: Simon Richter
  • Date: 2016-06-30 07:59:44 UTC
  • Revision ID: simon.richter@hogyros.de-20160630075944-t5uholufgqwi4azy
Schematic Cleanup: Split lines at net ties

Show diffs side-by-side

added added

removed removed

Lines of Context:
518
518
                    modified = true;
519
519
                }
520
520
            }
 
521
            else if( lhs_isTie && rhs_isLine )
 
522
            {
 
523
                auto lhs_pos = item->GetPosition();
 
524
 
 
525
                SCH_LINE* rhs_line = (SCH_LINE*) testItem;
 
526
 
 
527
                auto start_pos = rhs_line->GetStartPoint();
 
528
                auto end_pos = rhs_line->GetEndPoint();
 
529
 
 
530
                if( lhs_pos != start_pos && lhs_pos != end_pos && rhs_line->HitTest( lhs_pos, 0 ) )
 
531
                {
 
532
                    // Split segment at junction
 
533
                    SCH_LINE* new_line = new SCH_LINE( *rhs_line );
 
534
                    rhs_line->SetEndPoint( lhs_pos );
 
535
                    new_line->SetStartPoint( lhs_pos );
 
536
                    Append( new_line );
 
537
                }
 
538
            }
521
539
        }
522
540
    }
523
541