From 61b6026361cbd18d669ccdd130a601969676628e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 23 Nov 2012 01:15:20 -0800 Subject: [PATCH] Rename CompoundPath#flatten() to #reduce(), to avoid clash with Path#flatten(). --- src/path/CompoundPath.js | 2 +- src/path/Path.js | 6 +++--- src/svg/SvgImport.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 7567e525..3f16fb82 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -72,7 +72,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# * * @return {CompoundPath|Path} the flattened compound path */ - flatten: function() { + reduce: function() { if (this._children.length == 1) { var child = this._children[0]; child.insertAbove(this); diff --git a/src/path/Path.js b/src/path/Path.js index 3dc6ce66..584f8ca4 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -948,10 +948,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ }, /** - * For simple paths, flatten always returns the path itself. See - * {@link CompoundPath#flatten()} for more explanations. + * For simple paths, reduce always returns the path itself. See + * {@link CompoundPath#reduce()} for more explanations. */ - flatten: function() { + reduce: function() { return this; }, diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index ddff6c0b..4e3b18f9 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -382,7 +382,7 @@ new function() { break; // http://www.w3.org/TR/SVG/masking.html#ClipPathProperty case 'clip-path': - var clipPath = getDefinition(value).clone().flatten(); + var clipPath = getDefinition(value).clone().reduce(); item = createClipGroup(item, clipPath); break; // http://www.w3.org/TR/SVG/types.html#DataTypeTransformList