mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Rename CompoundPath#flatten() to #reduce(), to avoid clash with Path#flatten().
This commit is contained in:
parent
1fd3d727d2
commit
61b6026361
3 changed files with 5 additions and 5 deletions
|
@ -72,7 +72,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
|
||||||
*
|
*
|
||||||
* @return {CompoundPath|Path} the flattened compound path
|
* @return {CompoundPath|Path} the flattened compound path
|
||||||
*/
|
*/
|
||||||
flatten: function() {
|
reduce: function() {
|
||||||
if (this._children.length == 1) {
|
if (this._children.length == 1) {
|
||||||
var child = this._children[0];
|
var child = this._children[0];
|
||||||
child.insertAbove(this);
|
child.insertAbove(this);
|
||||||
|
|
|
@ -948,10 +948,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For simple paths, flatten always returns the path itself. See
|
* For simple paths, reduce always returns the path itself. See
|
||||||
* {@link CompoundPath#flatten()} for more explanations.
|
* {@link CompoundPath#reduce()} for more explanations.
|
||||||
*/
|
*/
|
||||||
flatten: function() {
|
reduce: function() {
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,7 @@ new function() {
|
||||||
break;
|
break;
|
||||||
// http://www.w3.org/TR/SVG/masking.html#ClipPathProperty
|
// http://www.w3.org/TR/SVG/masking.html#ClipPathProperty
|
||||||
case 'clip-path':
|
case 'clip-path':
|
||||||
var clipPath = getDefinition(value).clone().flatten();
|
var clipPath = getDefinition(value).clone().reduce();
|
||||||
item = createClipGroup(item, clipPath);
|
item = createClipGroup(item, clipPath);
|
||||||
break;
|
break;
|
||||||
// http://www.w3.org/TR/SVG/types.html#DataTypeTransformList
|
// http://www.w3.org/TR/SVG/types.html#DataTypeTransformList
|
||||||
|
|
Loading…
Reference in a new issue