Loading common/base_screen.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ wxPoint BASE_SCREEN::getCrossHairScreenPosition() const void BASE_SCREEN::setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid ) { if( aSnapToGrid ) m_crossHairPosition = getNearestGridPosition( aPosition, aGridOrigin ); m_crossHairPosition = getNearestGridPosition( aPosition, aGridOrigin, NULL ); else m_crossHairPosition = aPosition; } Loading common/base_units.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -209,8 +209,28 @@ wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymb StripTrailingZeros( stringValue, 3 ); #else std::string s = Double2Str( value_to_print ); wxString stringValue = FROM_UTF8( s.c_str() ); char buf[50]; int len; if( value_to_print != 0.0 && fabs( value_to_print ) <= 0.0001 ) { len = sprintf( buf, "%.10f", value_to_print ); while( --len > 0 && buf[len] == '0' ) buf[len] = '\0'; if( buf[len]=='.' || buf[len]==',' ) buf[len] = '\0'; else ++len; } else { len = sprintf( buf, "%.10g", value_to_print ); } wxString stringValue( buf, wxConvUTF8 ); #endif Loading include/class_base_screen.h +4 −4 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ private: * @param aInvertY Inverts the Y axis position. * @return The cross hair position in drawing coordinates. */ wxPoint getCrossHairPosition( bool aInvertY = false ) const wxPoint getCrossHairPosition( bool aInvertY ) const { if( aInvertY ) return wxPoint( m_crossHairPosition.x, -m_crossHairPosition.y ); Loading @@ -119,7 +119,7 @@ private: * \a aPosition. * */ void setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid = true ); void setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid ); /** * Function getCursorScreenPosition Loading @@ -138,7 +138,7 @@ private: * @return The nearst grid position. */ wxPoint getNearestGridPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, wxRealPoint* aGridSize = NULL ) const; wxRealPoint* aGridSize ) const; /** * Function getCursorPosition Loading @@ -149,7 +149,7 @@ private: * if \a aOnGrid is true. * @return The current cursor position. */ wxPoint getCursorPosition( bool aOnGrid, const wxPoint& aGridOrigin, wxRealPoint* aGridSize = NULL ) const; wxPoint getCursorPosition( bool aOnGrid, const wxPoint& aGridOrigin, wxRealPoint* aGridSize ) const; void setMousePosition( const wxPoint& aPosition ) { m_MousePosition = aPosition; } Loading Loading
common/base_screen.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ wxPoint BASE_SCREEN::getCrossHairScreenPosition() const void BASE_SCREEN::setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid ) { if( aSnapToGrid ) m_crossHairPosition = getNearestGridPosition( aPosition, aGridOrigin ); m_crossHairPosition = getNearestGridPosition( aPosition, aGridOrigin, NULL ); else m_crossHairPosition = aPosition; } Loading
common/base_units.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -209,8 +209,28 @@ wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymb StripTrailingZeros( stringValue, 3 ); #else std::string s = Double2Str( value_to_print ); wxString stringValue = FROM_UTF8( s.c_str() ); char buf[50]; int len; if( value_to_print != 0.0 && fabs( value_to_print ) <= 0.0001 ) { len = sprintf( buf, "%.10f", value_to_print ); while( --len > 0 && buf[len] == '0' ) buf[len] = '\0'; if( buf[len]=='.' || buf[len]==',' ) buf[len] = '\0'; else ++len; } else { len = sprintf( buf, "%.10g", value_to_print ); } wxString stringValue( buf, wxConvUTF8 ); #endif Loading
include/class_base_screen.h +4 −4 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ private: * @param aInvertY Inverts the Y axis position. * @return The cross hair position in drawing coordinates. */ wxPoint getCrossHairPosition( bool aInvertY = false ) const wxPoint getCrossHairPosition( bool aInvertY ) const { if( aInvertY ) return wxPoint( m_crossHairPosition.x, -m_crossHairPosition.y ); Loading @@ -119,7 +119,7 @@ private: * \a aPosition. * */ void setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid = true ); void setCrossHairPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, bool aSnapToGrid ); /** * Function getCursorScreenPosition Loading @@ -138,7 +138,7 @@ private: * @return The nearst grid position. */ wxPoint getNearestGridPosition( const wxPoint& aPosition, const wxPoint& aGridOrigin, wxRealPoint* aGridSize = NULL ) const; wxRealPoint* aGridSize ) const; /** * Function getCursorPosition Loading @@ -149,7 +149,7 @@ private: * if \a aOnGrid is true. * @return The current cursor position. */ wxPoint getCursorPosition( bool aOnGrid, const wxPoint& aGridOrigin, wxRealPoint* aGridSize = NULL ) const; wxPoint getCursorPosition( bool aOnGrid, const wxPoint& aGridOrigin, wxRealPoint* aGridSize ) const; void setMousePosition( const wxPoint& aPosition ) { m_MousePosition = aPosition; } Loading