Skip to content

Commit

Permalink
Tweak curved label cost of placing away from center (increase cost sl…
Browse files Browse the repository at this point in the history
…ightly to encourage more central placements)

(cherry picked from commit b04374d)
  • Loading branch information
nyalldawson committed Jun 10, 2019
1 parent b3d29cc commit 8bf2e91
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/pal/feature.cpp
Expand Up @@ -1248,7 +1248,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition * > &lPos
// penalize positions which are further from the line's midpoint
double labelCenter = distanceAlongLineToStartCandidate + getLabelWidth() / 2;
double costCenter = std::fabs( total_distance / 2 - labelCenter ) / total_distance; // <0, 0.5>
cost += costCenter / 1000; // < 0, 0.0005 >
cost += costCenter / 100; // < 0, 0.005 >
slp->setCost( cost );

// average angle is calculated with respect to periodicity of angles
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8bf2e91

Please sign in to comment.