translate as a text bucket property

When used, text is translated before being checked for collisions.
This commit is contained in:
Ansis Brammanis
2014-05-30 03:50:25 -04:00
parent 41c310c762
commit 7c653895c6
4 changed files with 21 additions and 13 deletions

View File

@@ -260,9 +260,6 @@ void Placement::addFeature(TextBucket& bucket,
Anchors anchors;
// TODO: figure out correct ascender height.
vec2<float> origin{0, 0};
if (line.size() == 1) {
// Point labels
anchors = Anchors{{Anchor{
@@ -282,7 +279,7 @@ void Placement::addFeature(TextBucket& bucket,
PlacedGlyphs glyphs;
GlyphBoxes boxes;
getGlyphs(glyphs, boxes, anchor, origin, shaping, face, fontScale, horizontal,
getGlyphs(glyphs, boxes, anchor, info.translate, shaping, face, fontScale, horizontal,
line, maxAngleDelta, rotate);
PlacementProperty place =
collision.place(boxes, anchor, anchor.scale, maxPlacementScale,