Make zooming straight in at the bottom level do nothing rather than moving half a pixel across with odd sized windows (which makes the whole screen look blurry in chrome). We need floor rather than round otherwise we move 1px in each direction.
This commit is contained in:
parent
19ed1859bd
commit
8667f357f2
@ -57,6 +57,16 @@ L.Point.prototype = {
|
||||
return this;
|
||||
},
|
||||
|
||||
floor: function () {
|
||||
return this.clone()._floor();
|
||||
},
|
||||
|
||||
_floor: function () {
|
||||
this.x = Math.floor(this.x);
|
||||
this.y = Math.floor(this.y);
|
||||
return this;
|
||||
},
|
||||
|
||||
clone: function () {
|
||||
return new L.Point(this.x, this.y);
|
||||
},
|
||||
|
@ -62,7 +62,7 @@ L.Map.include(!(L.Transition && L.Transition.implemented()) ? {} : {
|
||||
|
||||
_panByIfClose: function (center) {
|
||||
// difference between the new and current centers in pixels
|
||||
var offset = this._getCenterOffset(center);
|
||||
var offset = this._getCenterOffset(center)._floor();
|
||||
|
||||
if (this._offsetIsWithinView(offset)) {
|
||||
this.panBy(offset);
|
||||
|
Loading…
Reference in New Issue
Block a user