Skip to content

Commit

Permalink
Remove unecessary redraw(). Helps with #407 (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofsumit committed Feb 20, 2019
1 parent 9e1ccac commit b5fac29
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/Edit/L.PM.Edit.Line.js
Expand Up @@ -494,7 +494,7 @@ Edit.Line = Edit.extend({
parent.splice(index, 1, latlng);

// set new coords on layer
this._layer.setLatLngs(coords).redraw();
this._layer.setLatLngs(coords);
},

_onMarkerDrag(e) {
Expand Down
3 changes: 0 additions & 3 deletions src/js/Edit/L.PM.Edit.Rectangle.js
Expand Up @@ -110,9 +110,6 @@ Edit.Rectangle = Edit.Polygon.extend({
// Update bounding box
this._layer.setLatLngs(corners);

// Redraw the shape a final time
this._layer.redraw();

this._layer.fire('pm:markerdragend', {
markerEvent: e,
});
Expand Down
4 changes: 2 additions & 2 deletions src/js/Mixins/Drag.js
Expand Up @@ -166,13 +166,13 @@ const DragMixin = {
const newCoords = moveCoord(this._layer.getLatLng());

// set new coordinates and redraw
this._layer.setLatLng(newCoords).redraw();
this._layer.setLatLng(newCoords);
} else {
// create the new coordinates array
const newCoords = moveCoords(this._layer.getLatLngs());

// set new coordinates and redraw
this._layer.setLatLngs(newCoords).redraw();
this._layer.setLatLngs(newCoords);
}

// save current latlng for next delta calculation
Expand Down

0 comments on commit b5fac29

Please sign in to comment.