View / avoid solving constraints related to map size change during anim

This commit is contained in:
Olivier Guyot
2020-04-02 14:14:40 +02:00
parent a073c5ab1e
commit 32321e381c
3 changed files with 53 additions and 2 deletions

View File

@@ -762,11 +762,14 @@ class View extends BaseObject {
* Stores the viewport size on the view. The viewport size is not read every time from the DOM
* to avoid performance hit and layout reflow.
* This should be done on map size change.
* Note: the constraints are not resolved during an animation to avoid stopping it
* @param {import("./size.js").Size=} opt_size Viewport size; if undefined, [100, 100] is assumed
*/
setViewportSize(opt_size) {
this.viewportSize_ = Array.isArray(opt_size) ? opt_size.slice() : [100, 100];
this.resolveConstraints(0);
if (!this.getAnimating()) {
this.resolveConstraints(0);
}
}
/**