DIMENSION::m_Value not being saved in LEGACY_PLUGIN using scaling, DIMENSION::AdjustDimensionDetails() uses arrowz appropriate to build
This commit is contained in:
parent
8975fd3cf4
commit
0588092184
|
@ -240,14 +240,14 @@ void DIMENSION::Mirror( const wxPoint& axis_pos )
|
||||||
|
|
||||||
void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
{
|
{
|
||||||
#define ARROW_SIZE 500 //size of arrows
|
const int arrowz = DMils2iu( 500 ); // size of arrows
|
||||||
int ii;
|
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_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 arrow_dw_X = 0, arrow_dw_Y = 0; // coordinates of arrow line '\'
|
||||||
int hx, hy; // dimension line interval
|
int hx, hy; // dimension line interval
|
||||||
double angle, angle_f;
|
double angle, angle_f;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
// Init layer :
|
// Init layer :
|
||||||
m_Text.SetLayer( GetLayer() );
|
m_Text.SetLayer( GetLayer() );
|
||||||
|
@ -260,7 +260,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
deltay = m_featureLineDOy - m_featureLineGOy;
|
deltay = m_featureLineDOy - m_featureLineGOy;
|
||||||
|
|
||||||
// Calculate dimension value
|
// Calculate dimension value
|
||||||
mesure = KiROUND( hypot( (double) deltax, (double) deltay ) );
|
measure = KiROUND( hypot( (double) deltax, (double) deltay ) );
|
||||||
|
|
||||||
if( deltax || deltay )
|
if( deltax || deltay )
|
||||||
angle = atan2( (double) deltay, (double) deltax );
|
angle = atan2( (double) deltay, (double) deltax );
|
||||||
|
@ -271,10 +271,10 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
hx = hy = ii;
|
hx = hy = ii;
|
||||||
|
|
||||||
// Taking into account the slope of the side lines.
|
// Taking into account the slope of the side lines.
|
||||||
if( mesure )
|
if( measure )
|
||||||
{
|
{
|
||||||
hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
|
hx = (abs) ( (int) ( ( (double) deltay * hx ) / measure ) );
|
||||||
hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
|
hy = (abs) ( (int) ( ( (double) deltax * hy ) / measure ) );
|
||||||
|
|
||||||
if( m_featureLineGOx > m_crossBarOx )
|
if( m_featureLineGOx > m_crossBarOx )
|
||||||
hx = -hx;
|
hx = -hx;
|
||||||
|
@ -289,14 +289,13 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
hy = 0;
|
hy = 0;
|
||||||
|
|
||||||
angle_f = angle + (M_PI * 27.5 / 180);
|
angle_f = angle + (M_PI * 27.5 / 180);
|
||||||
arrow_up_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
arrow_up_X = (int) ( arrowz * cos( angle_f ) );
|
||||||
arrow_up_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
arrow_up_Y = (int) ( arrowz * sin( angle_f ) );
|
||||||
angle_f = angle - (M_PI * 27.5 / 180);
|
angle_f = angle - (M_PI * 27.5 / 180);
|
||||||
arrow_dw_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
arrow_dw_X = (int) ( arrowz * cos( angle_f ) );
|
||||||
arrow_dw_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
arrow_dw_Y = (int) ( arrowz * sin( angle_f ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_arrowG1Ox = m_crossBarOx;
|
m_arrowG1Ox = m_crossBarOx;
|
||||||
m_arrowG1Oy = m_crossBarOy;
|
m_arrowG1Oy = m_crossBarOy;
|
||||||
m_arrowG1Fx = m_crossBarOx + arrow_up_X;
|
m_arrowG1Fx = m_crossBarOx + arrow_up_X;
|
||||||
|
@ -345,7 +344,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
|
|
||||||
if( !aDoNotChangeText )
|
if( !aDoNotChangeText )
|
||||||
{
|
{
|
||||||
m_Value = mesure;
|
m_Value = measure;
|
||||||
msg = ::CoordinateToString( m_Value );
|
msg = ::CoordinateToString( m_Value );
|
||||||
SetText( msg );
|
SetText( msg );
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, "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() )
|
if( !me->m_Text.GetText().IsEmpty() )
|
||||||
fprintf( m_fp, "Te %s\n", EscapedUTF8( me->m_Text.GetText() ).c_str() );
|
fprintf( m_fp, "Te %s\n", EscapedUTF8( me->m_Text.GetText() ).c_str() );
|
||||||
|
|
Loading…
Reference in New Issue