fix bboxify where first box should be placed after anchor

-js: e99ed95aaba5e79c322733b32e03518b12203a79
This commit is contained in:
Ansis Brammanis
2015-04-06 12:35:16 -07:00
parent 148294d3ac
commit 34a5bf665e

View File

@@ -45,7 +45,7 @@ void CollisionFeature::bboxifyLabel(const std::vector<Coordinate> &line,
float anchorDistance = firstBoxOffset;
// move backwards along the line to the first segment the label appears on
while (anchorDistance > -labelLength / 2) {
do {
index--;
// there isn't enough room for the label after the beginning of the line
@@ -54,7 +54,7 @@ void CollisionFeature::bboxifyLabel(const std::vector<Coordinate> &line,
anchorDistance -= util::dist<float>(line[index], p);
p = line[index];
}
} while (anchorDistance > -labelLength / 2);
float segmentLength = util::dist<float>(line[index], line[index + 1]);