Skip to content

Commit

Permalink
Constrain resolution when fit called without duration
Browse files Browse the repository at this point in the history
  • Loading branch information
M393 committed Sep 15, 2020
1 parent 2de80e0 commit 02536f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ol/View.js
Expand Up @@ -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,
},
Expand Down

0 comments on commit 02536f8

Please sign in to comment.