make the debug flag atomic and move to MapData
This commit is contained in:
@@ -591,18 +591,17 @@ void Map::updateAnnotationTiles(std::vector<Tile::ID>& ids) {
|
||||
#pragma mark - Toggles
|
||||
|
||||
void Map::setDebug(bool value) {
|
||||
debug = value;
|
||||
assert(painter);
|
||||
painter->setDebug(debug);
|
||||
triggerUpdate();
|
||||
data->setDebug(value);
|
||||
triggerUpdate(Update::Debug);
|
||||
}
|
||||
|
||||
void Map::toggleDebug() {
|
||||
setDebug(!debug);
|
||||
data->toggleDebug();
|
||||
triggerUpdate(Update::Debug);
|
||||
}
|
||||
|
||||
bool Map::getDebug() const {
|
||||
return debug;
|
||||
return data->getDebug();
|
||||
}
|
||||
|
||||
void Map::addClass(const std::string& klass) {
|
||||
@@ -765,6 +764,10 @@ void Map::prepare() {
|
||||
if (u & static_cast<UpdateType>(Update::StyleInfo)) {
|
||||
reloadStyle();
|
||||
}
|
||||
if (u & static_cast<UpdateType>(Update::Debug)) {
|
||||
assert(painter);
|
||||
painter->setDebug(data->getDebug());
|
||||
}
|
||||
|
||||
// Update transform transitions.
|
||||
animationTime = std::chrono::steady_clock::now();
|
||||
|
||||
Reference in New Issue
Block a user