Subtract off the block's base point coordinate from the insert translation
This commit is contained in:
parent
cac0d93dfd
commit
cc7264c0b9
|
@ -483,8 +483,8 @@ void DXF_IMPORT_PLUGIN::addInsert( const DL_InsertData& aData )
|
||||||
VECTOR3D insertCoords = ocsToWcs( arbAxis, VECTOR3D( aData.ipx, aData.ipy, aData.ipz ) );
|
VECTOR3D insertCoords = ocsToWcs( arbAxis, VECTOR3D( aData.ipx, aData.ipy, aData.ipz ) );
|
||||||
|
|
||||||
VECTOR2D translation( mapX( insertCoords.x ), mapY( insertCoords.y ) );
|
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() )
|
for( auto& shape : block->m_buffer.GetShapes() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,15 +139,15 @@ class DXF_IMPORT_BLOCK
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
double m_x, m_y;
|
double m_baseX, m_baseY;
|
||||||
|
|
||||||
GRAPHICS_IMPORTER_BUFFER m_buffer;
|
GRAPHICS_IMPORTER_BUFFER m_buffer;
|
||||||
|
|
||||||
DXF_IMPORT_BLOCK( wxString aName, double aX, double aY )
|
DXF_IMPORT_BLOCK( wxString aName, double aX, double aY )
|
||||||
{
|
{
|
||||||
m_name = aName;
|
m_name = aName;
|
||||||
m_x = aX;
|
m_baseX = aX;
|
||||||
m_y = aY;
|
m_baseY = aY;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue