View / add getValidCenter method to improve interactions
The DragPan, KeyboardPan and DragZoom interactions now make sure to animate to a valid center/resolution target to avoid a chained "resolve" animation which looks weird. The `View.fit` method was also fixed to use this.
This commit is contained in:
@@ -116,7 +116,7 @@ class DragPan extends PointerInteraction {
|
||||
centerpx[1] - distance * Math.sin(angle)
|
||||
]);
|
||||
view.animate({
|
||||
center: dest,
|
||||
center: view.getValidCenter(dest),
|
||||
duration: 500,
|
||||
easing: easeOut
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user