[core] Load sources only if there is at least one visible layer
This commit is contained in:
@@ -39,9 +39,7 @@ Source::Source() {}
|
||||
Source::~Source() = default;
|
||||
|
||||
bool Source::isLoaded() const {
|
||||
if (!loaded) {
|
||||
return false;
|
||||
}
|
||||
if (!loaded) return false;
|
||||
|
||||
for (const auto& tile : tiles) {
|
||||
if (tile.second->data->getState() != TileData::State::parsed) {
|
||||
@@ -52,6 +50,10 @@ bool Source::isLoaded() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Source::isLoading() const {
|
||||
return !loaded && req.operator bool();
|
||||
}
|
||||
|
||||
// Note: This is a separate function that must be called exactly once after creation
|
||||
// The reason this isn't part of the constructor is that calling shared_from_this() in
|
||||
// the constructor fails.
|
||||
|
||||
Reference in New Issue
Block a user