Browse Source

Subtract off the block's base point coordinate from the insert translation

6.0.7
Marek Roszko 5 years ago
parent
commit
cc7264c0b9
  1. 2
      pcbnew/import_gfx/dxf_import_plugin.cpp
  2. 6
      pcbnew/import_gfx/dxf_import_plugin.h

2
pcbnew/import_gfx/dxf_import_plugin.cpp

@ -483,8 +483,8 @@ void DXF_IMPORT_PLUGIN::addInsert( const DL_InsertData& aData )
VECTOR3D insertCoords = ocsToWcs( arbAxis, VECTOR3D( aData.ipx, aData.ipy, aData.ipz ) );
VECTOR2D translation( mapX( insertCoords.x ), mapY( insertCoords.y ) );
translation -= VECTOR2D( mapX( block->m_baseX ), mapY( block->m_baseY ) );
// TODO: implement handling of scale
for( auto& shape : block->m_buffer.GetShapes() )
{

6
pcbnew/import_gfx/dxf_import_plugin.h

@ -139,15 +139,15 @@ class DXF_IMPORT_BLOCK
{
public:
wxString m_name;
double m_x, m_y;
double m_baseX, m_baseY;
GRAPHICS_IMPORTER_BUFFER m_buffer;
DXF_IMPORT_BLOCK( wxString aName, double aX, double aY )
{
m_name = aName;
m_x = aX;
m_y = aY;
m_baseX = aX;
m_baseY = aY;
}
};

Loading…
Cancel
Save