summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-02-03 02:58:33 -0800
committerMinh Nguyễn <mxn@1ec5.org>2018-02-20 22:29:30 -0800
commit28dbd1830b7c870332a18a841fc40ca1104d0ce1 (patch)
tree0f33cf6a17e4bdfe2d61c3557213ec6024d3f05b
parent5b38169d843423c0b0e5ff56a518d144fe537d0d (diff)
downloadqtlocation-mapboxgl-28dbd1830b7c870332a18a841fc40ca1104d0ce1.tar.gz
[ios, macos] Align descending glyphs with baseline
-rw-r--r--platform/darwin/src/shaping.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/darwin/src/shaping.mm b/platform/darwin/src/shaping.mm
index cde3272e9c..8490f6f6ef 100644
--- a/platform/darwin/src/shaping.mm
+++ b/platform/darwin/src/shaping.mm
@@ -63,10 +63,10 @@ float shapeLine(Shaping& shaping, const std::u16string& text, const float y) {
for (CFIndex j = 0; j < runGlyphCount; j++) {
CGRect frame = boundingRects[j];
frame.origin.x += runAdvance.width;
- //frame.origin.y += runAdvance.height;
+ frame.origin.y += runAdvance.height;
runAdvance.width += advances[j].width;
runAdvance.height += advances[j].height;
- shaping.positionedGlyphs.emplace_back(GlyphID(fontName, PTR_OR_ARRAY(runGlyphs)[j]), frame.origin.x, y + frame.origin.y - frame.size.height, false);
+ shaping.positionedGlyphs.emplace_back(GlyphID(fontName, PTR_OR_ARRAY(runGlyphs)[j]), CGRectGetMinX(frame), y - CGRectGetHeight(frame), false);
maxLineLength = std::max<float>(maxLineLength, frame.origin.x + frame.size.width);
}
free(runGlyphs);