View / add support for viewport extent constraint
This introduces a breaking change: The `extent` view option now constrains the whole viewport and not just the view center. The option `constrainOnlyCenter` was added to keep the previous behaviour. Constraining the whole viewport and not only the view center means that the center and resolution constraints must be applied with a knowledge of the viewport size.
This commit is contained in:
@@ -5,7 +5,7 @@ import {toRadians} from './math.js';
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function((number|undefined), number): (number|undefined)} Type
|
||||
* @typedef {function((number|undefined), number, boolean=): (number|undefined)} Type
|
||||
*/
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ export function createSnapToN(n) {
|
||||
/**
|
||||
* @param {number|undefined} rotation Rotation.
|
||||
* @param {number} delta Delta.
|
||||
* @param {boolean=} opt_isMoving True if an interaction or animation is in progress.
|
||||
* @return {number|undefined} Rotation.
|
||||
*/
|
||||
function(rotation, delta, opt_isMoving) {
|
||||
|
||||
Reference in New Issue
Block a user