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

« back to all changes in this revision

Viewing changes to pcbnew/class_dimension.cpp

More int casts to rounding conversions

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
    deltay  = m_featureLineDO.y - m_featureLineGO.y;
239
239
 
240
240
    // Calculate dimension value
241
 
    measure = KiROUND( hypot( (double) deltax, (double) deltay ) );
 
241
    measure = KiROUND( hypot( deltax, deltay ) );
242
242
 
243
243
    angle = atan2( deltay, deltax );
244
244
 
248
248
    // Taking into account the slope of the side lines.
249
249
    if( measure )
250
250
    {
251
 
        hx  = (abs) ( (int) ( ( (double) deltay * hx ) / measure ) );
252
 
        hy  = (abs) ( (int) ( ( (double) deltax * hy ) / measure ) );
 
251
        hx  = abs( KiROUND( ( (double) deltay * hx ) / measure ) );
 
252
        hy  = abs( KiROUND( ( (double) deltax * hy ) / measure ) );
253
253
 
254
254
        if( m_featureLineGO.x > m_crossBarO.x )
255
255
            hx = -hx;