Skip to content

Commit

Permalink
fix issues from Nyall review
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Sep 24, 2018
1 parent 1b82abf commit 9c1dc79
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/core/mesh/qgsmeshlayerrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ void QgsMeshLayerRenderer::renderMesh( const QgsMeshRendererMeshSettings &settin
if ( mContext.flags() & QgsRenderContext::Antialiasing )
painter->setRenderHint( QPainter::Antialiasing, true );

painter->setRenderHint( QPainter::Antialiasing );
QPen pen = painter->pen();
pen.setCapStyle( Qt::FlatCap );
pen.setJoinStyle( Qt::MiterJoin );
Expand Down
1 change: 0 additions & 1 deletion src/core/mesh/qgsmeshvectorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void QgsMeshVectorRenderer::draw()
if ( mContext.flags() & QgsRenderContext::Antialiasing )
painter->setRenderHint( QPainter::Antialiasing, true );

painter->setRenderHint( QPainter::Antialiasing );
QPen pen = painter->pen();
pen.setCapStyle( Qt::FlatCap );
pen.setJoinStyle( Qt::MiterJoin );
Expand Down
20 changes: 15 additions & 5 deletions src/core/mesh/qgstriangularmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "qgsgeometry.h"
#include "qgsrectangle.h"
#include "qgsfeatureiterator.h"
#include "qgslogger.h"

///@cond PRIVATE

Expand Down Expand Up @@ -133,11 +134,20 @@ void QgsTriangularMesh::update( QgsMesh *nativeMesh, QgsRenderContext *context )
const QgsMeshVertex &vertex = nativeMesh->vertices.at( i );
if ( mCoordinateTransform.isValid() )
{
QgsPointXY mapPoint = mCoordinateTransform.transform( QgsPointXY( vertex.x(), vertex.y() ) );
QgsMeshVertex mapVertex( mapPoint );
mapVertex.setZ( vertex.z() );
mapVertex.setM( vertex.m() );
mTriangularMesh.vertices[i] = mapVertex;
try
{
QgsPointXY mapPoint = mCoordinateTransform.transform( QgsPointXY( vertex.x(), vertex.y() ) );
QgsMeshVertex mapVertex( mapPoint );
mapVertex.setZ( vertex.z() );
mapVertex.setM( vertex.m() );
mTriangularMesh.vertices[i] = mapVertex;
}
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsg( QStringLiteral( "Caught CRS exception %1" ).arg( cse.what() ) );
mTriangularMesh.vertices[i] = vertex;
}
}
else
{
Expand Down

0 comments on commit 9c1dc79

Please sign in to comment.