Skip to content
Permalink
Browse files

dxf import: fix text positions and orientation when importing DXF (fixes

  • Loading branch information
jef-n committed Dec 23, 2016
1 parent 645f2c8 commit 567f9208d1d78710db7ef144db776868dd8bfbe0
Showing with 7 additions and 6 deletions.
  1. +3 −4 src/app/dwg/libdxfrw/drw_entities.cpp
  2. +4 −2 src/app/dwg/qgsdwgimporter.cpp
@@ -1224,8 +1224,7 @@ void DRW_Insert::parseCode( int code, dxfReader *reader )
zscale = reader->getDouble();
break;
case 50:
angle = reader->getDouble();
angle = angle / ARAD; //convert to radian
angle = reader->getDouble() / ARAD;
break;
case 70:
colcount = reader->getInt32();
@@ -1590,7 +1589,7 @@ void DRW_Text::parseCode( int code, dxfReader *reader )
widthscale = reader->getDouble();
break;
case 50:
angle = reader->getDouble();
angle = reader->getDouble() / ARAD;
break;
case 51:
oblique = reader->getDouble();
@@ -1630,7 +1629,7 @@ bool DRW_Text::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )

QgsDebugMsg( "***************************** parsing text *********************************************" );

// DataFlags RC Used to determine presence of subsquent data, set to 0xFF for R14-
// DataFlags RC Used to determine presence of subsequent data, set to 0xFF for R14-
duint8 data_flags = 0x00;
if ( version > DRW::AC1014 ) //2000+
{
@@ -2270,8 +2270,10 @@ void QgsDwgImporter::addText( const DRW_Text &data )

setPoint( dfn, f, "ext", data.extPoint );

QgsPointV2 p( QgsWkbTypes::PointZ, data.secPoint.x, data.secPoint.y, data.secPoint.z );

QgsPointV2 p( QgsWkbTypes::PointZ,
( data.alignH > 0 || data.alignV > 0 ) ? data.secPoint.x : data.basePoint.x,
( data.alignH > 0 || data.alignV > 0 ) ? data.secPoint.y : data.basePoint.y,
( data.alignH > 0 || data.alignV > 0 ) ? data.secPoint.z : data.basePoint.z );

if ( !createFeature( layer, f, p ) )
{

0 comments on commit 567f920

Please sign in to comment.
You can’t perform that action at this time.