fix panBy immediately with non-zero spring

This commit is contained in:
Doug 2025-04-04 21:03:19 +10:30 committed by GitHub
parent 99fcb408fe
commit e5175188c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -827,10 +827,14 @@ $.Viewport.prototype = {
* @fires OpenSeadragon.Viewer.event:pan
*/
panBy: function( delta, immediately ) {
var center = new $.Point(
this.centerSpringX.target.value,
this.centerSpringY.target.value
);
var center = new $.Point();
if (immediately) {
center.x = this.centerSpringX.current.value;
center.y = this.centerSpringY.current.value;
} else {
center.x = this.centerSpringX.target.value;
center.y = this.centerSpringY.target.value;
}
return this.panTo( center.plus( delta ), immediately );
},