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)
  • Loading branch information
nyalldawson committed May 30, 2019
1 parent f9b8c6f commit b04374d
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 @@ -1240,7 +1240,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 b04374d

Please sign in to comment.