From 16dbe11868d2d206609de6790325ffa16477ca6b Mon Sep 17 00:00:00 2001 From: Jon Neal Date: Mon, 21 Mar 2016 10:15:56 -0400 Subject: [PATCH] Change misspelled dxf conversion constant from member variable to static const like other conversion constants. --- pcbnew/import_dxf/dxf2brd_items.cpp | 7 +++---- pcbnew/import_dxf/dxf2brd_items.h | 10 +++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pcbnew/import_dxf/dxf2brd_items.cpp b/pcbnew/import_dxf/dxf2brd_items.cpp index db65306f1d..fece4b618a 100644 --- a/pcbnew/import_dxf/dxf2brd_items.cpp +++ b/pcbnew/import_dxf/dxf2brd_items.cpp @@ -51,7 +51,6 @@ DXF2BRD_CONVERTER::DXF2BRD_CONVERTER() : DRW_Interface() { m_xOffset = 0.0; // X coord offset for conversion (in mm) m_yOffset = 0.0; // Y coord offset for conversion (in mm) - m_Dfx2mm = 1.0; // The scale factor to convert DXF units to mm m_version = 0; m_defaultThickness = 0.1; m_brdLayer = Dwgs_User; @@ -66,19 +65,19 @@ DXF2BRD_CONVERTER::~DXF2BRD_CONVERTER() // coordinate conversions from dxf to internal units int DXF2BRD_CONVERTER::mapX( double aDxfCoordX ) { - return Millimeter2iu( m_xOffset + ( aDxfCoordX * m_Dfx2mm ) ); + return Millimeter2iu( m_xOffset + ( aDxfCoordX * DXF_UNITS_PER_MM ) ); } int DXF2BRD_CONVERTER::mapY( double aDxfCoordY ) { - return Millimeter2iu( m_yOffset - ( aDxfCoordY * m_Dfx2mm ) ); + return Millimeter2iu( m_yOffset - ( aDxfCoordY * DXF_UNITS_PER_MM ) ); } int DXF2BRD_CONVERTER::mapDim( double aDxfValue ) { - return Millimeter2iu( aDxfValue * m_Dfx2mm ); + return Millimeter2iu( aDxfValue * DXF_UNITS_PER_MM ); } diff --git a/pcbnew/import_dxf/dxf2brd_items.h b/pcbnew/import_dxf/dxf2brd_items.h index c95ec0965a..88285c7507 100644 --- a/pcbnew/import_dxf/dxf2brd_items.h +++ b/pcbnew/import_dxf/dxf2brd_items.h @@ -33,6 +33,13 @@ class BOARD; class BOARD_ITEM; +/** + * Conversion factor for DXF units to millimeters + * It seems DRW_Interface always converts DXF coordinates in mm + * (to be confirmed) + */ +static const double DXF_UNITS_PER_MM = 1.0; + /** * This format filter class can import and export DXF files. * It depends on the dxflib library. @@ -46,9 +53,6 @@ private: double m_xOffset; // X coord offset for conversion (in mm) double m_yOffset; // Y coord offset for conversion (in mm) double m_defaultThickness; // default line thickness for conversion (in mm) - double m_Dfx2mm; // The scale factor to convert DXF units to mm - // Seems DRW_Interface always converts DXF coordinates in mm - // (to be confirmed) int m_brdLayer; // The board layer to place imported dfx items int m_version; // the dxf version, not used here std::string m_codePage; // The code page, not used here