Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Relayout after recalculating to ensure visibility changes are handled correctly #7242

Merged
merged 3 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"lodash": "^4.16.4",
"mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#b51b85ffb8c512e228c36c5405293ce51d123519",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#49e8b407bdbbe6f7c92dbcb56d3d51f425fc2653",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#9252ffc5108131704b5acf52d78258ac05687871",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#66397c8ee0426537d25e8d4cfcac134ca21a021b",
"mkdirp": "^0.5.1",
"node-cmake": "^1.2.1",
"request": "^2.72.0",
Expand Down
11 changes: 3 additions & 8 deletions platform/node/test/suite_implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@ module.exports = function (style, options, callback) {
callback();

} else if (operation[0] === 'wait') {
var wait = function () {
if (map.loaded()) {
applyOperations(operations.slice(1), callback);
} else {
map.render(options, wait);
}
};
wait();
map.render(options, function () {
applyOperations(operations.slice(1), callback);
});

} else {
// Ensure that the next `map.render(options)` does not overwrite this change.
Expand Down
8 changes: 4 additions & 4 deletions src/mbgl/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ void Map::Impl::update() {
annotationManager->updateData();
}

if (updateFlags & Update::Layout) {
style->relayout();
}

if (updateFlags & Update::Classes) {
style->cascade(timePoint, mode);
}
Expand All @@ -265,6 +261,10 @@ void Map::Impl::update() {
style->recalculate(transform.getZoom(), timePoint, mode);
}

if (updateFlags & Update::Layout) {
style->relayout();
}

style::UpdateParameters parameters(pixelRatio,
debugOptions,
transform.getState(),
Expand Down
4 changes: 2 additions & 2 deletions src/mbgl/style/source_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ void Source::Impl::updateTiles(const UpdateParameters& parameters) {

if (type != SourceType::Annotations && cache.getSize() == 0) {
size_t conservativeCacheSize =
((float)parameters.transformState.getSize().width / util::tileSize) *
((float)parameters.transformState.getSize().height / util::tileSize) *
std::max((float)parameters.transformState.getSize().width / util::tileSize, 1.0f) *
std::max((float)parameters.transformState.getSize().height / util::tileSize, 1.0f) *
(parameters.transformState.getMaxZoom() - parameters.transformState.getMinZoom() + 1) *
0.5;
cache.setSize(conservativeCacheSize);
Expand Down