[Pkg-javascript-commits] [leaflet] 05/301: New stroke-linecap style option with a VML alternative. For #1643.

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet.

commit 665a956bc2ac633ff31388860d91545285adcf22
Author: palewire <ben.welsh at gmail.com>
Date:   Fri Jul 12 22:37:30 2013 -0700

    New stroke-linecap style option with a VML alternative. For #1643.
---
 src/layer/vector/Path.SVG.js | 3 +++
 src/layer/vector/Path.VML.js | 3 +++
 src/layer/vector/Path.js     | 1 +
 3 files changed, 7 insertions(+)

diff --git a/src/layer/vector/Path.SVG.js b/src/layer/vector/Path.SVG.js
index 723b8ed..9e08557 100644
--- a/src/layer/vector/Path.SVG.js
+++ b/src/layer/vector/Path.SVG.js
@@ -80,6 +80,9 @@ L.Path = L.Path.extend({
 			} else {
 				this._path.removeAttribute('stroke-dasharray');
 			}
+			if (this.options.linecap) {
+				this._path.setAttribute('stroke-linecap', this.options.linecap);
+			}
 		} else {
 			this._path.setAttribute('stroke', 'none');
 		}
diff --git a/src/layer/vector/Path.VML.js b/src/layer/vector/Path.VML.js
index 265b797..cf98a72 100644
--- a/src/layer/vector/Path.VML.js
+++ b/src/layer/vector/Path.VML.js
@@ -82,6 +82,9 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({
 			} else {
 				stroke.dashStyle = '';
 			}
+			if (options.linecap) {
+				stroke.endcap = options.linecap.replace('butt', 'flat');
+			}
 
 		} else if (stroke) {
 			container.removeChild(stroke);
diff --git a/src/layer/vector/Path.js b/src/layer/vector/Path.js
index ca242fe..14a1484 100644
--- a/src/layer/vector/Path.js
+++ b/src/layer/vector/Path.js
@@ -18,6 +18,7 @@ L.Path = L.Class.extend({
 		stroke: true,
 		color: '#0033ff',
 		dashArray: null,
+		linecap: null,
 		weight: 5,
 		opacity: 0.5,
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list