From 52dd24097f494cb8d3b11b9a228b87012988d1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 11 Sep 2014 16:06:00 +0200 Subject: [PATCH] Define PathIterator#getPoint(), #getTangent(), #getNormal() and #getCurvature(). --- src/path/PathIterator.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/path/PathIterator.js b/src/path/PathIterator.js index 401a73e7..14d445da 100644 --- a/src/path/PathIterator.js +++ b/src/path/PathIterator.js @@ -151,4 +151,11 @@ var PathIterator = Base.extend({ ctx.bezierCurveTo.apply(ctx, curve.slice(2)); } } -}); +}, Base.each(['getPoint', 'getTangent', 'getNormal', 'getCurvature'], + function(name, index) { + this[name] = function(offset) { + return this.evaluate(offset, index); + }; + }, {}) +); +