diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-12-19 17:16:43 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-12-19 18:09:33 +0200 |
commit | cc684df73655e04051dea6540959838735195c85 (patch) | |
tree | 8d23351f758bf6a7d8e21110803ddcccb2e9d215 | |
parent | 28ccb0ccc08416b9e8ced25ae938a50ca4a00151 (diff) | |
download | qtlocation-mapboxgl-cc684df73655e04051dea6540959838735195c85.tar.gz |
[core] Handle zero text size
The style specification stipulates that `text-size` values must be positive
(https://docs.mapbox.com/mapbox-gl-js/style-spec/#layout-symbol-text-size).
However, a zero value could be passed to the engine (e.g. as a result of
an expression) this patch handles it and avoids assertion hit in `shaping.cpp`.
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index fc8af2c076..499f1113cc 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -359,7 +359,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap, const float layoutIconSize = layout->evaluate<IconSize>(zoom + 1, feature); // if feature has text, shape the text - if (feature.formattedText) { + if (feature.formattedText && layoutTextSize > 0.0f) { const float lineHeight = layout->get<TextLineHeight>() * util::ONE_EM; const float spacing = util::i18n::allowsLetterSpacing(feature.formattedText->rawText()) ? layout->evaluate<TextLetterSpacing>(zoom, feature) * util::ONE_EM : 0.0f; |