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:
parent
924d4563b7
commit
7ba08962ba
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue