diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-07-09 14:10:54 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-08-13 13:32:56 +0300 |
commit | 44c92b837a45b476cda062b5a19d3fbbfa669395 (patch) | |
tree | c8adc3c30f693f9d766d7e64cfff6b358e34d254 /src | |
parent | be974ea65ca48b7f49ef00148193fb30861938d3 (diff) | |
download | qtlocation-mapboxgl-44c92b837a45b476cda062b5a19d3fbbfa669395.tar.gz |
[core] Break lines for vertical writing mode
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/text/shaping.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index 132f74661e..3ed35fc725 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -238,9 +238,8 @@ std::set<std::size_t> leastBadBreaks(const PotentialBreak& lastLineBreak) { std::set<std::size_t> determineLineBreaks(const TaggedString& logicalInput, const float spacing, float maxWidth, - const WritingModeType writingMode, const GlyphMap& glyphMap) { - if (!maxWidth || writingMode != WritingModeType::Horizontal) { + if (!maxWidth) { return {}; } @@ -382,13 +381,13 @@ const Shaping getShaping(const TaggedString& formattedString, std::vector<TaggedString> reorderedLines; if (formattedString.sectionCount() == 1) { auto untaggedLines = bidi.processText(formattedString.rawText(), - determineLineBreaks(formattedString, spacing, maxWidth, writingMode, glyphs)); + determineLineBreaks(formattedString, spacing, maxWidth, glyphs)); for (const auto& line : untaggedLines) { reorderedLines.emplace_back(line, formattedString.sectionAt(0)); } } else { auto processedLines = bidi.processStyledText(formattedString.getStyledText(), - determineLineBreaks(formattedString, spacing, maxWidth, writingMode, glyphs)); + determineLineBreaks(formattedString, spacing, maxWidth, glyphs)); for (const auto& line : processedLines) { reorderedLines.emplace_back(line, formattedString.getSections()); } |