Commit 36dac0c1 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew nanometer: fix hatch lines issue in polyline.cpp

Some minor code cleaning.
parent e730219b
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
#ifndef CONVERT_TO_BIU_H
#define CONVERT_TO_BIU_H

#include <config.h>     // USE_PCBNEW_NANOMETRES is defined here

/**
 * @file convert_to_biu.h
 */


/**
 * @brief inline convert functions to convert a value in decimils (or mils)
 * to the internal unit used in pcbnew or cvpcb(nanometer or decimil)
 * depending on compil option
 */

/// Convert mils to PCBNEW internal units (iu).
inline int Mils2iu( int mils )
{
#if defined( USE_PCBNEW_NANOMETRES )
    return int( mils * 25.4e3 + 0.5 );
#else
    return mils * 10;
#endif
}

/// Convert deci-mils to PCBNEW internal units (iu).
inline int DMils2iu( int dmils )
{
#if defined( USE_PCBNEW_NANOMETRES )
    return int( dmils * 25.4e2 + 0.5 );
#else
    return dmils;
#endif
}

#endif  // #define CONVERT_TO_BIU_H
+0 −7
Original line number Diff line number Diff line
@@ -71,13 +71,6 @@ BOARD::BOARD() :

BOARD::~BOARD()
{
    /*  @todo
        NO!  this has nothing to do with a BOARD
        Do this in the UI, not in the storage container please.
    if( m_PcbFrame && m_PcbFrame->GetScreen() )
        m_PcbFrame->GetScreen()->ClearUndoRedoList();
    */

    while( m_ZoneDescriptorList.size() )
    {
        ZONE_CONTAINER* area_to_remove = m_ZoneDescriptorList[0];
+8 −0
Original line number Diff line number Diff line
@@ -272,6 +272,14 @@ public:
     */
    static wxString GetDefaultLayerName( int aLayerNumber );

    /**
     * Function ReturnFlippedLayerNumber
     * @return the layer number after flipping an item
     * some (not all) layers: external copper, Mask, Paste, and solder
     * are swapped between front and back sides
     */
    static int ReturnFlippedLayerNumber( int oldlayer );

    /**
     * Function Add
     * adds the given item to this BOARD and takes ownership of its memory.
+1 −2
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include <class_drawpanel.h>
#include <colors_selection.h>
#include <kicad_string.h>
#include <protos.h>
#include <richio.h>

#include <class_board.h>
@@ -200,7 +199,7 @@ void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
void DIMENSION::Flip( const wxPoint& aCentre )
{
    Mirror( aCentre );
    SetLayer( ChangeSideNumLayer( GetLayer() ) );
    SetLayer( BOARD::ReturnFlippedLayerNumber( GetLayer() ) );
}


+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre )
        NEGATE( m_Angle );
    }

    SetLayer( ChangeSideNumLayer( GetLayer() ) );
    SetLayer( BOARD::ReturnFlippedLayerNumber( GetLayer() ) );
}


Loading