Skip to content
Permalink
Browse files

Dxf export: fix offset and offset rotation for simple marker

  • Loading branch information
mhugent committed Mar 27, 2018
1 parent 2235bf5 commit c53968f7c12baf3a74c2139f508f780d3a6485fb
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
@@ -1335,6 +1335,8 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
double offsetX = 0;
double offsetY = 0;
markerOffset( context, offsetX, offsetY );
offsetX *= context.renderContext().mapToPixel().mapUnitsPerPixel();
offsetY *= context.renderContext().mapToPixel().mapUnitsPerPixel();

QPointF off( offsetX, offsetY );

@@ -1359,14 +1361,13 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
}
}

angle = -angle; //rotation in Qt is counterclockwise
if ( angle )
off = _rotatedOffset( off, angle );

off *= e.mapUnitScaleFactor( e.symbologyScaleDenominator(), mSizeUnit, e.mapUnits() );

QTransform t;
t.translate( shift.x() + offsetX, shift.y() - offsetY );
t.translate( shift.x() + off.x(), shift.y() - off.y() );

if ( !qgsDoubleNear( angle, 0.0 ) )
t.rotate( angle );

0 comments on commit c53968f

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