Skip to content
Permalink
Browse files

Avoid unnecessary centroid calculation for every label

  • Loading branch information
m-kuhn committed Jan 22, 2020
1 parent 1144974 commit 5929047c0b472587ceb3fcf12269a95ce4e0864f
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/labeling/qgspallabeling.cpp
@@ -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;

0 comments on commit 5929047

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