summaryrefslogtreecommitdiff
path: root/src/mbgl/text/shaping.cpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-04 09:21:39 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-04 10:20:50 +0200
commit3bfdb110646f33953fe7c44a6f4db7cdbb540d6a (patch)
treedebe16042c8eeac83a27e9608f5cca1127ef39e7 /src/mbgl/text/shaping.cpp
parent6802a2ec5c0bce57ac51462f123792f475c58419 (diff)
downloadqtlocation-mapboxgl-3bfdb110646f33953fe7c44a6f4db7cdbb540d6a.tar.gz
[core] Assign formatted section index to quads
Diffstat (limited to 'src/mbgl/text/shaping.cpp')
-rw-r--r--src/mbgl/text/shaping.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp
index 3a6335955b..02dbf146e1 100644
--- a/src/mbgl/text/shaping.cpp
+++ b/src/mbgl/text/shaping.cpp
@@ -299,7 +299,8 @@ void shapeLines(Shaping& shaping,
std::size_t lineStartIndex = shaping.positionedGlyphs.size();
for (std::size_t i = 0; i < line.length(); i++) {
- const SectionOptions& section = line.getSection(i);
+ const std::size_t sectionIndex = line.getSectionIndex(i);
+ const SectionOptions& section = line.sectionAt(sectionIndex);
char16_t codePoint = line.getCharCodeAt(i);
auto glyphs = glyphMap.find(section.fontStackHash);
if (glyphs == glyphMap.end()) {
@@ -318,10 +319,10 @@ void shapeLines(Shaping& shaping,
const Glyph& glyph = **it->second;
if (writingMode == WritingModeType::Horizontal || !util::i18n::hasUprightVerticalOrientation(codePoint)) {
- shaping.positionedGlyphs.emplace_back(codePoint, x, y + baselineOffset, false, section.fontStackHash, section.scale);
+ shaping.positionedGlyphs.emplace_back(codePoint, x, y + baselineOffset, false, section.fontStackHash, section.scale, sectionIndex);
x += glyph.metrics.advance * section.scale + spacing;
} else {
- shaping.positionedGlyphs.emplace_back(codePoint, x, baselineOffset, true, section.fontStackHash, section.scale);
+ shaping.positionedGlyphs.emplace_back(codePoint, x, baselineOffset, true, section.fontStackHash, section.scale, sectionIndex);
x += verticalHeight * section.scale + spacing;
}
}