Skip to content
Permalink
Browse files

Avoid creating 3 identical label candidates in offset point mode

...should speed up label position calculation
  • Loading branch information
nyalldawson committed Mar 18, 2015
1 parent d45eea1 commit 92c8434769e6f38b23db4429a3156df2e277a336
Showing with 1 addition and 9 deletions.
  1. +1 −9 src/core/pal/feature.cpp
@@ -279,7 +279,7 @@ namespace pal
{
Q_UNUSED( scale );
Q_UNUSED( delta_width );
int nbp = 3;
int nbp = 1;
*lPos = new LabelPosition *[nbp];

// get from feature
@@ -349,15 +349,7 @@ namespace pal
lx = x + xdiff;
ly = y + ydiff;

// double offset = label_x / 4;
double offset = 0.0; // don't shift what is supposed to be fixed

// at the center
( *lPos )[0] = new LabelPosition( id, lx, ly, label_x, label_y, angle, cost, this );
// shifted to the sides - with higher cost
cost = 0.0021;
( *lPos )[1] = new LabelPosition( id, lx + offset, ly, label_x, label_y, angle, cost, this );
( *lPos )[2] = new LabelPosition( id, lx - offset, ly, label_x, label_y, angle, cost, this );
return nbp;
}

0 comments on commit 92c8434

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