summaryrefslogtreecommitdiff
path: root/src/mbgl/sprite
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-15 21:04:15 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-15 21:04:15 -0800
commite304033552fd423db5324545216f9cf3a1e62150 (patch)
treea7e162af70b10e440a515d43b6fef9e618decf6a /src/mbgl/sprite
parent0f37b670bac6aace6b83148ccee3b63e42a6896c (diff)
downloadqtlocation-mapboxgl-e304033552fd423db5324545216f9cf3a1e62150.tar.gz
[core] Fixed annotation icon replacement
Another pass at #3146, including a unit test.
Diffstat (limited to 'src/mbgl/sprite')
-rw-r--r--src/mbgl/sprite/sprite_atlas.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp
index 202218f51c..d09330e17b 100644
--- a/src/mbgl/sprite/sprite_atlas.cpp
+++ b/src/mbgl/sprite/sprite_atlas.cpp
@@ -189,11 +189,10 @@ void SpriteAtlas::updateDirty() {
holder.texture = spriteIterator->second;
if (holder.texture != nullptr) {
copy(holder, imageIterator->first.second);
+ ++imageIterator;
} else {
- images.erase(imageIterator);
+ images.erase(imageIterator++);
}
-
- ++imageIterator;
// Don't advance the spriteIterator because there might be another sprite with the same
// name, but a different wrap value.
}