diff options
author | Ansis Brammanis <ansis.brammanis@gmail.com> | 2019-04-08 16:28:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 16:28:55 -0400 |
commit | 104091cd9302c1377b9e4ffb56fc47fac36a2024 (patch) | |
tree | 6833e3f7aac80260631c1df4be660efc2face4ac /src | |
parent | 37a886570345ea00d705c3cbe58059be33dda130 (diff) | |
download | qtlocation-mapboxgl-104091cd9302c1377b9e4ffb56fc47fac36a2024.tar.gz |
fix firing onStyleImageMissing after sprite has loaded (#14369)
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/renderer/image_manager.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/renderer/image_manager.cpp b/src/mbgl/renderer/image_manager.cpp index f8f3e30f81..25acd6bd25 100644 --- a/src/mbgl/renderer/image_manager.cpp +++ b/src/mbgl/renderer/image_manager.cpp @@ -90,19 +90,20 @@ void ImageManager::getImages(ImageRequestor& requestor, ImageRequestPair&& pair) // if all icons are available. If any are missing, call `onStyleImageMissing` // to give the user a chance to provide the icon. If they are not provided // by the next frame we'll assume they are permanently missing. - bool hasAllDependencies = true; if (!isLoaded()) { + bool hasAllDependencies = true; for (const auto& dependency : pair.first) { if (images.find(dependency.first) == images.end()) { hasAllDependencies = false; + break; } } - } - if (hasAllDependencies) { - notify(requestor, pair); - } else if (!isLoaded()) { - requestors.emplace(&requestor, std::move(pair)); + if (hasAllDependencies) { + notify(requestor, pair); + } else { + requestors.emplace(&requestor, std::move(pair)); + } } else { checkMissingAndNotify(requestor, std::move(pair)); } |