Move inline function declaration to allow removing include

This commit is contained in:
Marek Roszko 2021-06-01 19:03:22 -04:00
parent 0dbfd28942
commit 45d1684bbe
2 changed files with 21 additions and 6 deletions

View File

@ -53,6 +53,18 @@
#endif
int Mm2mils( double x )
{
return KiROUND( x * 1000. / 25.4 );
}
int Mils2mm( double x )
{
return KiROUND( x * 25.4 / 1000. );
}
double To_User_Unit( EDA_UNITS aUnit, double aValue )
{
switch( aUnit )
@ -74,6 +86,7 @@ double To_User_Unit( EDA_UNITS aUnit, double aValue )
}
}
/**
* Convert a value to a string using double notation.
*

View File

@ -36,7 +36,6 @@
#include <eda_units.h>
#include <convert_to_biu.h>
#include <math/util.h> // for KiROUND
#include <math/vector2d.h>
//TODO: Abstract Base Units to a single class
@ -57,12 +56,15 @@
#define ALLOW_BOLD_THICKNESS IsBold()
#endif
/**
* Convert mm to mils.
*/
int Mm2mils( double x );
/// Convert mm to mils.
inline int Mm2mils( double x ) { return KiROUND( x * 1000./25.4 ); }
/// Convert mils to mm.
inline int Mils2mm( double x ) { return KiROUND( x * 25.4 / 1000. ); }
/**
* Convert mils to mm.
*/
int Mils2mm( double x );
/**
* Function To_User_Unit