diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-11-10 15:02:13 +0100 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2016-11-11 20:18:16 +0100 |
commit | 39b0bc0a402248e29791f93aeab5a6234bf80862 (patch) | |
tree | 5070bd07901a366801a0bc0d575251a4a01c3f4c /src/mbgl/style/style.cpp | |
parent | 517db640ab718929aba0787c985ff007a81f30d9 (diff) | |
download | qtlocation-mapboxgl-39b0bc0a402248e29791f93aeab5a6234bf80862.tar.gz |
[core] symbol layer - recalculate style on icon/text size changes
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r-- | src/mbgl/style/style.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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 { |