~fmorgner/kicad/kicad

« back to all changes in this revision

Viewing changes to pcbnew/class_track.cpp

  • Committer: Felix Morgner
  • Date: 2013-05-02 03:03:52 UTC
  • mfrom: (4107.1.20 kicad)
  • Revision ID: felix.morgner@gmail.com-20130502030352-vxk56hy89xqgfimo
merge with upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <gr_basic.h>
34
34
#include <common.h>
35
35
#include <trigo.h>
 
36
#include <macros.h>
36
37
#include <class_drawpanel.h>
37
38
#include <class_pcb_screen.h>
38
39
#include <drawtxt.h>
295
296
    {
296
297
        double dist = hypot( (double)dx, (double) dy );
297
298
 
298
 
        if( min_dist >= (int) dist )
 
299
        if( min_dist >= KiROUND( dist ) )
299
300
            result |= STARTPOINT;
300
301
    }
301
302
 
311
312
    {
312
313
        double dist = hypot( (double) dx, (double) dy );
313
314
 
314
 
        if( min_dist >= (int) dist )
 
315
        if( min_dist >= KiROUND( dist ) )
315
316
            result |= ENDPOINT;
316
317
    }
317
318
 
618
619
 
619
620
    if( m_Shape == S_CIRCLE )
620
621
    {
621
 
        radius = (int) hypot( (double) ( m_End.x - m_Start.x ),
622
 
                              (double) ( m_End.y - m_Start.y ) );
 
622
        radius = KiROUND( GetLineLength( m_Start, m_End ) );
623
623
 
624
624
        if( aDC->LogicalToDeviceXRel( l_trace ) <= MIN_DRAW_WIDTH )
625
625
        {
691
691
 
692
692
    #define THRESHOLD 10
693
693
 
694
 
    int len = int( hypot( (m_End.x - m_Start.x), (m_End.y - m_Start.y) ) );
 
694
    int len = KiROUND( GetLineLength( m_Start, m_End ) );
695
695
 
696
696
    if( len < THRESHOLD * m_Width )
697
697
        return;