From a552d151ea14f47144acfeec79964537071c21ae Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Thu, 19 Dec 2019 17:16:43 +0200 Subject: [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`. --- src/mbgl/layout/symbol_layout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(zoom + 1, feature); // if feature has text, shape the text - if (feature.formattedText) { + if (feature.formattedText && layoutTextSize > 0.0f) { const float lineHeight = layout->get() * util::ONE_EM; const float spacing = util::i18n::allowsLetterSpacing(feature.formattedText->rawText()) ? layout->evaluate(zoom, feature) * util::ONE_EM : 0.0f; -- cgit v1.2.1