Commit 1f50b2c7 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew: Fix an other compatibility issue in kicad nanometers.

parent 0028c054
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -489,9 +489,6 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition )
// we must have a default distance between the test point
// and a corner or a zone edge:
#define MIN_DIST_IN_MILS 10
// if we know the scaling factor, a dist in pixel can be used:
#define HIT_TEST_USE_PIXELS 1   // Set to 0 to used only a fixed default distance
#define MIN_DIST_IN_PIXELS 10

bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
{
@@ -500,15 +497,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
    // distance (in internal units) to detect a corner in a zone outline.
    int min_dist = MIN_DIST_IN_MILS*IU_PER_MILS;

#if HIT_TEST_USE_PIXELS
    // If possible, use a fixed number of pixels.
    if( GetBoard() && GetBoard()->GetParent() )
    {
        double scale = ((PCB_BASE_FRAME*)GetBoard()->GetParent())->GetScreen()->GetScalingFactor();
        min_dist = KiROUND( MIN_DIST_IN_PIXELS / scale);
    }
#endif

    wxPoint delta;
    unsigned lim = m_Poly->corner.size();

@@ -540,15 +528,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
    // distance (in internal units) to detect a zone outline
    int min_dist = MIN_DIST_IN_MILS*IU_PER_MILS;

#if HIT_TEST_USE_PIXELS
    // If possible, use a fixed number of pixels.
    if( GetBoard() && GetBoard()->GetParent() )
    {
        double scale = ((PCB_BASE_FRAME*)GetBoard()->GetParent())->GetScreen()->GetScalingFactor();
        min_dist = KiROUND( MIN_DIST_IN_PIXELS / scale);
    }
#endif

    unsigned first_corner_pos = 0;

    for( unsigned item_pos = 0; item_pos < lim; item_pos++ )
+3 −6
Original line number Diff line number Diff line
@@ -511,12 +511,9 @@ public:

    void SetCornerRadius( unsigned int aRadius )
    {
        if( aRadius > MAX_ZONE_CORNER_RADIUS )
            cornerRadius = MAX_ZONE_CORNER_RADIUS;
        else if( aRadius < 0 )
            cornerRadius = 0;
        else
        cornerRadius = aRadius;
        if( cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
            cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
    };

    unsigned int GetCornerRadius() const { return cornerRadius; };
+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
class ZONE_CONTAINER;


#define MAX_ZONE_CORNER_RADIUS 4000
#define MAX_ZONE_CORNER_RADIUS_MILS 400


/**
@@ -83,8 +83,8 @@ public:

    void SetCornerRadius( int aRadius )
    {
        if( aRadius > MAX_ZONE_CORNER_RADIUS )
            cornerRadius = MAX_ZONE_CORNER_RADIUS;
        if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
            cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
        else if( aRadius < 0 )
            cornerRadius = 0;
        else