Merge pull request #961 from danzel/canvas-fixes
Optimize _requestUpdate in Path.Canvas.
This commit is contained in:
commit
1933ae157c
@ -42,13 +42,13 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
|
||||
},
|
||||
|
||||
_requestUpdate: function () {
|
||||
if (this._map) {
|
||||
L.Util.cancelAnimFrame(this._fireMapMoveEnd);
|
||||
this._updateRequest = L.Util.requestAnimFrame(this._fireMapMoveEnd, this._map);
|
||||
if (this._map && !L.Path._updateRequest) {
|
||||
L.Path._updateRequest = L.Util.requestAnimFrame(this._fireMapMoveEnd, this._map);
|
||||
}
|
||||
},
|
||||
|
||||
_fireMapMoveEnd: function () {
|
||||
L.Path._updateRequest = null;
|
||||
this.fire('moveend');
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user