Commit 5d5698d6 authored by dickelbeck's avatar dickelbeck

non-immediate aperture macro parameters

parent 39ba8945
...@@ -132,9 +132,9 @@ public: ...@@ -132,9 +132,9 @@ public:
*/ */
bool IsImmediate() const { return index == -1; } bool IsImmediate() const { return index == -1; }
int GetIndex() const unsigned GetIndex() const
{ {
return index; return (unsigned) index;
} }
void SetIndex( int aIndex ) void SetIndex( int aIndex )
...@@ -235,6 +235,8 @@ typedef std::pair<APERTURE_MACRO_SET::iterator, bool> APERTURE_MACRO_SET_PAIR; ...@@ -235,6 +235,8 @@ typedef std::pair<APERTURE_MACRO_SET::iterator, bool> APERTURE_MACRO_SET_PAIR;
*/ */
class D_CODE class D_CODE
{ {
friend class DCODE_PARAM;
APERTURE_MACRO* m_Macro; ///< no ownership, points to GERBER.m_aperture_macros element APERTURE_MACRO* m_Macro; ///< no ownership, points to GERBER.m_aperture_macros element
/** /**
...@@ -288,8 +290,17 @@ inline double DCODE_PARAM::GetValue( const D_CODE* aDcode ) const ...@@ -288,8 +290,17 @@ inline double DCODE_PARAM::GetValue( const D_CODE* aDcode ) const
return value; return value;
else else
{ {
// get the parameter from aDcode // the first one was numbered 1, not zero, as in $1, see page 19 of spec.
return 0.0; unsigned ndx = GetIndex() - 1;
// get the parameter from the aDcode
if( ndx < aDcode->m_am_params.size() )
return aDcode->m_am_params[ndx].GetValue( NULL );
else
{
wxASSERT( GetIndex()-1 < aDcode->m_am_params.size() );
return 0.0;
}
} }
} }
......
...@@ -967,11 +967,11 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -967,11 +967,11 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
if( start.x == end.x ) if( start.x == end.x )
{ {
size.x = width; size.x = width;
size.y = ABS( end.y - start.y ); size.y = ABS( end.y - start.y ) + 1;
} }
else else
{ {
size.x = ABS( end.x - start.x ); size.x = ABS( end.x - start.x ) + 1;
size.y = width; size.y = width;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment