Eeschema/Common: convert mils to IU using doubles

The .kicad_pro file can contain fractional mils, and users working in
millimeters would also see weird rounding issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7865
This commit is contained in:
Mike Williams 2021-07-25 13:08:01 -04:00 committed by Jeff Young
parent 924d4563b7
commit 7ba08962ba
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ constexpr int ARC_HIGH_DEF = Millimeter2iu( 0.005 );
constexpr double PCB_IU_PER_MILS = (PCB_IU_PER_MM * 0.0254);
constexpr double SCH_IU_PER_MILS = (SCH_IU_PER_MM * 0.0254);
constexpr inline int SchMils2iu( int mils )
constexpr inline int SchMils2iu( double mils )
{
double x = mils * SCH_IU_PER_MILS;
return int( x < 0 ? x - 0.5 : x + 0.5 );