Skip to content

Commit

Permalink
Merge pull request #188 from jayhogan/patch-1
Browse files Browse the repository at this point in the history
Only update guideslines when guidelines are present
  • Loading branch information
jacobtoye committed Sep 15, 2013
2 parents 871cbcf + 0911f09 commit 8fab06c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/draw/handler/Draw.Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ L.Draw.Polyline = L.Draw.Feature.extend({
},

_updateGuide: function (newPos) {
newPos = newPos || this._map.latLngToLayerPoint(this._currentLatLng);

var markerCount = this._markers.length;

if (markerCount > 0) {
newPos = newPos || this._map.latLngToLayerPoint(this._currentLatLng);

// draw the guide line
this._clearGuides();
this._drawGuide(
Expand Down Expand Up @@ -397,4 +397,4 @@ L.Draw.Polyline = L.Draw.Feature.extend({
var poly = new this.Poly(this._poly.getLatLngs(), this.options.shapeOptions);
L.Draw.Feature.prototype._fireCreatedEvent.call(this, poly);
}
});
});

0 comments on commit 8fab06c

Please sign in to comment.