[core][tile mode] Fix placement mismatch for the labels with same geomerty

This commit is contained in:
Mikhail Pozdnyakov
2020-04-07 14:35:40 +03:00
parent 88337c23f7
commit fd218daa00

View File

@@ -1303,8 +1303,15 @@ void TilePlacement::placeLayers(const RenderLayerReferences& layers) {
if (a.status.minSectionLength != b.status.minSectionLength) {
return a.status.minSectionLength > b.status.minSectionLength;
}
// Finally, look at Y position.
return a.symbol.get().anchor.point.y < b.symbol.get().anchor.point.y;
// Look at the anchor coordinates
if (a.symbol.get().anchor.point.y != b.symbol.get().anchor.point.y) {
return a.symbol.get().anchor.point.y < b.symbol.get().anchor.point.y;
}
if (a.symbol.get().anchor.point.x != b.symbol.get().anchor.point.x) {
return a.symbol.get().anchor.point.x < b.symbol.get().anchor.point.x;
}
// Finally, looking at the key hashes.
return std::hash<std::u16string>()(a.symbol.get().key) < std::hash<std::u16string>()(b.symbol.get().key);
});
// Place intersections.
for (const auto& intersection : intersections) {