~pierre-parent-k/kicad/length-tunning

« back to all changes in this revision

Viewing changes to pcbnew/edit_track_width.cpp

  • Committer: Pierre Parent
  • Date: 2014-07-06 10:32:13 UTC
  • mfrom: (4798.1.179 kicad)
  • Revision ID: pierre.parent@insa-rouen.fr-20140706103213-wjsdy0hc9q6wbz5v
Merge with lp:kicad 4977

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    if( net )
44
44
        new_width = net->GetTrackWidth();
45
45
    else
46
 
        new_width = GetBoard()->GetCurrentTrackWidth();
 
46
        new_width = GetDesignSettings().GetCurrentTrackWidth();
47
47
 
48
48
    if( aTrackItem->Type() == PCB_VIA_T )
49
49
    {
50
 
        if( !aTrackItem->IsDrillDefault() )
51
 
            initial_drill = aTrackItem->GetDrillValue();
 
50
        const VIA *via = static_cast<const VIA *>( aTrackItem );
 
51
 
 
52
        if( !via->IsDrillDefault() )
 
53
            initial_drill = via->GetDrillValue();
52
54
 
53
55
        if( net )
54
56
        {
56
58
        }
57
59
        else
58
60
        {
59
 
            new_width = GetBoard()->GetCurrentViaSize();
60
 
            new_drill = GetBoard()->GetCurrentViaDrill();
 
61
            new_width = GetDesignSettings().GetCurrentViaSize();
 
62
            new_drill = GetDesignSettings().GetCurrentViaDrill();
61
63
        }
62
64
 
63
 
        if( aTrackItem->GetShape() == VIA_MICROVIA )
 
65
        if( via->GetViaType() == VIA_MICROVIA )
64
66
        {
65
67
            if( net )
66
68
                new_width = net->GetMicroViaSize();
67
69
            else
68
 
                new_width = GetBoard()->GetCurrentMicroViaSize();
 
70
                new_width = GetDesignSettings().GetCurrentMicroViaSize();
69
71
        }
70
72
    }
71
73
 
107
109
            if( aTrackItem->Type() == PCB_VIA_T )
108
110
            {
109
111
                // Set new drill value. Note: currently microvias have only a default drill value
 
112
                VIA *via = static_cast<VIA *>( aTrackItem );
110
113
                if( new_drill > 0 )
111
 
                    aTrackItem->SetDrill( new_drill );
 
114
                    via->SetDrill( new_drill );
112
115
                else
113
 
                    aTrackItem->SetDrillDefault();
 
116
                    via->SetDrillDefault();
114
117
            }
115
118
        }
116
119
    }