From 263fa8cbd970979be1bc0fe638cf5b3f68d1accf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jun 2011 18:35:00 +0100 Subject: [PATCH] Add comments. --- src/path/PathFlattener.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/path/PathFlattener.js b/src/path/PathFlattener.js index e69ce745..fd7e5f09 100644 --- a/src/path/PathFlattener.js +++ b/src/path/PathFlattener.js @@ -16,13 +16,18 @@ var PathFlattener = Base.extend({ initialize: function(path) { - this.parts = []; - this.curves = []; - this.length = 0; + this.curves = []; // The curve values as returned by getCurveValues() + this.parts = []; // The calculated, subdivided parts of the path + this.length = 0; // The total length of the path // Keep a current index from the part where we last where in // getParameter(), to optimise for iterator-like usage of the flattener. this.index = 0; + // Instead of relying on path.curves, we only use segments here and + // get the curve values from them. + + // Now walk through all curves and compute the parts for each of them, + // by recursively calling _computeParts(). var segments = path._segments, segment1 = segments[0], segment2,