From 39b0bc0a402248e29791f93aeab5a6234bf80862 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Thu, 10 Nov 2016 15:02:13 +0100 Subject: [core] symbol layer - recalculate style on icon/text size changes --- src/mbgl/style/style.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/mbgl/style/style.cpp') diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index acbc949b4c..57e2580d4d 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -572,9 +572,17 @@ void Style::onLayerPaintPropertyChanged(Layer&) { observer->onUpdate(Update::RecalculateStyle | Update::Classes); } -void Style::onLayerLayoutPropertyChanged(Layer& layer) { +void Style::onLayerLayoutPropertyChanged(Layer& layer, const char * property) { layer.accept(QueueSourceReloadVisitor { updateBatch }); - observer->onUpdate(Update::Layout); + + auto update = Update::Layout; + + //Recalculate the style for certain properties + bool needsRecalculation = strcmp(property, "icon-size") == 0 || strcmp(property, "text-size") == 0; + if (needsRecalculation) { + update |= Update::RecalculateStyle; + } + observer->onUpdate(update); } void Style::dumpDebugLogs() const { -- cgit v1.2.1