proper rounding of max bounds offsets

This commit is contained in:
Vladimir Agafonkin 2013-11-14 17:52:31 +02:00
parent 80607c6044
commit 507e6c7aa5

View File

@ -789,7 +789,9 @@ L.Map = L.Class.extend({
},
_rebound: function (left, right) {
return Math.round(left + right > 0 ? (left - right) / 2 : Math.max(0, left) - Math.max(0, right));
return left + right > 0 ?
Math.round(left - right) / 2 :
Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));
},
_limitZoom: function (zoom) {