Don't truncate mils properties in Property Inspector.
In fact, don't open-code yet another value-to-string impl. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16883
This commit is contained in:
parent
608294171b
commit
e98d1c968e
|
@ -234,34 +234,12 @@ wxString PGPROPERTY_DISTANCE::DistanceToString( wxVariant& aVariant, int aArgFla
|
||||||
{
|
{
|
||||||
wxCHECK( aVariant.GetType() == wxPG_VARIANT_TYPE_LONG, wxEmptyString );
|
wxCHECK( aVariant.GetType() == wxPG_VARIANT_TYPE_LONG, wxEmptyString );
|
||||||
|
|
||||||
long distanceIU = aVariant.GetLong();
|
long distanceIU = aVariant.GetLong();
|
||||||
|
ORIGIN_TRANSFORMS& transforms = m_parentFrame->GetOriginTransforms();
|
||||||
ORIGIN_TRANSFORMS& transforms = m_parentFrame->GetOriginTransforms();
|
|
||||||
const EDA_IU_SCALE& iuScale = m_parentFrame->GetIuScale();
|
|
||||||
|
|
||||||
distanceIU = transforms.ToDisplay( static_cast<long long int>( distanceIU ), m_coordType );
|
distanceIU = transforms.ToDisplay( static_cast<long long int>( distanceIU ), m_coordType );
|
||||||
|
|
||||||
switch( m_parentFrame->GetUserUnits() )
|
return m_parentFrame->StringFromValue( distanceIU, true, EDA_DATA_TYPE::DISTANCE );
|
||||||
{
|
|
||||||
case EDA_UNITS::INCHES:
|
|
||||||
return wxString::Format( wxS( "%g in" ), iuScale.IUToMils( distanceIU ) / 1000.0 );
|
|
||||||
|
|
||||||
case EDA_UNITS::MILS:
|
|
||||||
return wxString::Format( wxS( "%d mils" ), iuScale.IUToMils( distanceIU ) );
|
|
||||||
|
|
||||||
case EDA_UNITS::MILLIMETRES:
|
|
||||||
return wxString::Format( wxS( "%g mm" ), iuScale.IUTomm( distanceIU ) );
|
|
||||||
|
|
||||||
case EDA_UNITS::UNSCALED:
|
|
||||||
return wxString::Format( wxS( "%li" ), distanceIU );
|
|
||||||
|
|
||||||
default:
|
|
||||||
// DEGREEs are handled by PGPROPERTY_ANGLE
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxFAIL;
|
|
||||||
return wxEmptyString;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue