From 02d56488e40f1ae5d3408b3e9fe62166a27f4599 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 Feb 2017 13:06:57 -0800 Subject: [core] Eliminate Shaping::text This was already accessible via SymbolFeature::text. --- src/mbgl/layout/symbol_layout.cpp | 2 +- src/mbgl/text/glyph.hpp | 5 ++--- src/mbgl/text/glyph_set.cpp | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index e3c3d8946c..e1a4b0457f 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -363,7 +363,7 @@ void SymbolLayout::addFeature(const SymbolFeature& feature, overscaling); for (auto& anchor : anchors) { - if (!shapedTextOrientations.first || !anchorIsTooClose(shapedTextOrientations.first.text, textRepeatDistance, anchor)) { + if (!feature.text || !anchorIsTooClose(*feature.text, textRepeatDistance, anchor)) { addSymbolInstance(line, anchor); } } diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp index 78ea613cd3..175a36f0fa 100644 --- a/src/mbgl/text/glyph.hpp +++ b/src/mbgl/text/glyph.hpp @@ -68,10 +68,9 @@ enum class WritingModeType : uint8_t; class Shaping { public: explicit Shaping() : top(0), bottom(0), left(0), right(0) {} - explicit Shaping(float x, float y, std::u16string text_, WritingModeType writingMode_) - : text(std::move(text_)), top(y), bottom(y), left(x), right(x), writingMode(writingMode_) {} + explicit Shaping(float x, float y, WritingModeType writingMode_) + : top(y), bottom(y), left(x), right(x), writingMode(writingMode_) {} std::vector positionedGlyphs; - std::u16string text; int32_t top; int32_t bottom; int32_t left; diff --git a/src/mbgl/text/glyph_set.cpp b/src/mbgl/text/glyph_set.cpp index 61d5cac926..19a6e2cddd 100644 --- a/src/mbgl/text/glyph_set.cpp +++ b/src/mbgl/text/glyph_set.cpp @@ -45,9 +45,7 @@ const Shaping GlyphSet::getShaping(const std::u16string& logicalInput, const float verticalHeight, const WritingModeType writingMode, BiDi& bidi) const { - // The string stored in shaping.text is used for finding duplicates, but may end up quite - // different from the glyphs that get shown - Shaping shaping(translate.x * 24, translate.y * 24, logicalInput, writingMode); + Shaping shaping(translate.x * 24, translate.y * 24, writingMode); std::vector reorderedLines = bidi.processText(logicalInput, -- cgit v1.2.1