Skip to content

Commit

Permalink
Enable option 'offset: 0' (would be replaced by the value of the path…
Browse files Browse the repository at this point in the history
…'s stroke-width)
  • Loading branch information
plepe committed Dec 24, 2018
1 parent 8e6a171 commit 7244e43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leaflet.textpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ var PolylineTextPath = {
var textNode = L.SVG.create('text'),
textPath = L.SVG.create('textPath');

var dy = options.offset || this._path.getAttribute('stroke-width');
var dy = 'offset' in options ? options.offset : this._path.getAttribute('stroke-width');

textPath.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", '#'+id);
textNode.setAttribute('dy', dy);
Expand Down

0 comments on commit 7244e43

Please sign in to comment.