Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid unnecessary centroid calculation for every label
  • Loading branch information
m-kuhn committed Jan 22, 2020
1 parent 1144974 commit 5929047
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/labeling/qgspallabeling.cpp
Expand Up @@ -2012,8 +2012,12 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
bool ddXPos = false, ddYPos = false;
double quadOffsetX = 0.0, quadOffsetY = 0.0;
double offsetX = 0.0, offsetY = 0.0;
QgsPointXY anchorPosition = geom.centroid().asPoint();
QgsPointXY anchorPosition;

if ( placement == QgsPalLayerSettings::OverPoint )
{
anchorPosition = geom.centroid().asPoint();
}
//x/y shift in case of alignment
double xdiff = 0.0;
double ydiff = 0.0;
Expand Down

0 comments on commit 5929047

Please sign in to comment.