Commit 05880921 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

DIMENSION::m_Value not being saved in LEGACY_PLUGIN using scaling,...

DIMENSION::m_Value not being saved in LEGACY_PLUGIN using scaling, DIMENSION::AdjustDimensionDetails() uses arrowz appropriate to build
parent 8975fd3c
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
@@ -240,9 +240,9 @@ void DIMENSION::Mirror( const wxPoint& axis_pos )

void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
{
    #define ARROW_SIZE 500    //size of arrows
    const int   arrowz = DMils2iu( 500 );           // size of arrows
    int         ii;
    int      mesure, deltax, deltay;            //  value of the measure on X and Y axes
    int         measure, deltax, deltay;            //  value of the measure on X and Y axes
    int         arrow_up_X = 0, arrow_up_Y = 0;     //  coordinates of arrow line /
    int         arrow_dw_X = 0, arrow_dw_Y = 0;     //  coordinates of arrow line '\'
    int         hx, hy;                             //  dimension line interval
@@ -260,7 +260,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
    deltay = m_featureLineDOy - m_featureLineGOy;

    // Calculate dimension value
    mesure = KiROUND( hypot( (double) deltax, (double) deltay ) );
    measure = KiROUND( hypot( (double) deltax, (double) deltay ) );

    if( deltax || deltay )
        angle = atan2( (double) deltay, (double) deltax );
@@ -271,10 +271,10 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
    hx = hy = ii;

    // Taking into account the slope of the side lines.
    if( mesure )
    if( measure )
    {
        hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
        hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
        hx = (abs) ( (int) ( ( (double) deltay * hx ) / measure ) );
        hy = (abs) ( (int) ( ( (double) deltax * hy ) / measure ) );

        if( m_featureLineGOx > m_crossBarOx )
            hx = -hx;
@@ -289,14 +289,13 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
            hy = 0;

        angle_f     = angle + (M_PI * 27.5 / 180);
        arrow_up_X = (int) ( ARROW_SIZE * cos( angle_f ) );
        arrow_up_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
        arrow_up_X = (int) ( arrowz * cos( angle_f ) );
        arrow_up_Y = (int) ( arrowz * sin( angle_f ) );
        angle_f     = angle - (M_PI * 27.5 / 180);
        arrow_dw_X = (int) ( ARROW_SIZE * cos( angle_f ) );
        arrow_dw_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
        arrow_dw_X = (int) ( arrowz * cos( angle_f ) );
        arrow_dw_Y = (int) ( arrowz * sin( angle_f ) );
    }


    m_arrowG1Ox = m_crossBarOx;
    m_arrowG1Oy = m_crossBarOy;
    m_arrowG1Fx = m_crossBarOx + arrow_up_X;
@@ -345,7 +344,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )

    if( !aDoNotChangeText )
    {
        m_Value = mesure;
        m_Value = measure;
        msg = ::CoordinateToString( m_Value );
        SetText( msg );
    }
+1 −1
Original line number Diff line number Diff line
@@ -3617,7 +3617,7 @@ void LEGACY_PLUGIN::saveDIMENTION( const DIMENSION* me ) const

    fprintf( m_fp, "Ge %d %d %lX\n", me->GetShape(), me->GetLayer(), me->GetTimeStamp() );

    fprintf( m_fp, "Va %d\n", me->m_Value );
    fprintf( m_fp, "Va %s\n", fmtBIU( me->m_Value ).c_str() );

    if( !me->m_Text.GetText().IsEmpty() )
        fprintf( m_fp, "Te %s\n", EscapedUTF8( me->m_Text.GetText() ).c_str() );