Skip to content

Commit f7d99d1

Browse files
committed
Avoid creating 3 identical label candidates in offset point mode
...should speed up label position calculation
1 parent 790216f commit f7d99d1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/core/pal/feature.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ namespace pal
279279
{
280280
Q_UNUSED( scale );
281281
Q_UNUSED( delta_width );
282-
int nbp = 3;
282+
int nbp = 1;
283283
*lPos = new LabelPosition *[nbp];
284284

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

352-
// double offset = label_x / 4;
353-
double offset = 0.0; // don't shift what is supposed to be fixed
354-
355-
// at the center
356352
( *lPos )[0] = new LabelPosition( id, lx, ly, label_x, label_y, angle, cost, this );
357-
// shifted to the sides - with higher cost
358-
cost = 0.0021;
359-
( *lPos )[1] = new LabelPosition( id, lx + offset, ly, label_x, label_y, angle, cost, this );
360-
( *lPos )[2] = new LabelPosition( id, lx - offset, ly, label_x, label_y, angle, cost, this );
361353
return nbp;
362354
}
363355

0 commit comments

Comments
 (0)