~cern-kicad/kicad/kicad-pns-tom

« back to all changes in this revision

Viewing changes to pcbnew/class_pad.cpp

More int casts to rounding conversions

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        break;
104
104
 
105
105
    case PAD_RECT:
106
 
        radius = 1 + (int) ( sqrt( (double) m_Size.y * m_Size.y
107
 
                                 + (double) m_Size.x * m_Size.x ) / 2 );
 
106
        radius = 1 + KiROUND( EuclideanNorm( m_Size ) / 2 );
108
107
        break;
109
108
 
110
109
    case PAD_TRAPEZOID:
111
110
        x = m_Size.x + std::abs( m_DeltaSize.y );   // Remember: m_DeltaSize.y is the m_Size.x change
112
111
        y = m_Size.y + std::abs( m_DeltaSize.x );   // Remember: m_DeltaSize.x is the m_Size.y change
113
 
        radius = 1 + (int) ( sqrt( (double) y * y + (double) x * x ) / 2 );
 
112
        radius = 1 + KiROUND( hypot( x, y ) / 2 );
114
113
        break;
115
114
 
116
115
    default: