From fbcf0b5009ca1afce20d063df0e678e7edaef7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Tue, 15 Sep 2020 12:32:32 +0200 Subject: [PATCH] Constrain resolution when fit called without duration --- src/ol/View.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/View.js b/src/ol/View.js index 4103cd0f48..ffc75f2bd6 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -1290,14 +1290,14 @@ class View extends BaseObject { centerRotY += ((padding[0] - padding[2]) / 2) * resolution; const centerX = centerRotX * cosAngle - centerRotY * sinAngle; const centerY = centerRotY * cosAngle + centerRotX * sinAngle; - const center = [centerX, centerY]; + const center = this.getConstrainedCenter([centerX, centerY], resolution); const callback = options.callback ? options.callback : VOID; if (options.duration !== undefined) { this.animateInternal( { resolution: resolution, - center: this.getConstrainedCenter(center, resolution), + center: center, duration: options.duration, easing: options.easing, },