Define Path#toShape() and Shape#toPath() as aliases to #clone().

This commit is contained in:
Jürg Lehni 2016-01-09 12:08:47 +01:00
parent 8639051081
commit e8390a76d8
3 changed files with 4 additions and 1 deletions

View file

@ -1,4 +1,3 @@
/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/

View file

@ -186,6 +186,8 @@ var Shape = Item.extend(/** @lends Shape# */{
return path;
},
toShape: '#clone',
_draw: function(ctx, param, strokeMatrix) {
var style = this._style,
hasFill = style.hasFill(),

View file

@ -1522,6 +1522,8 @@ var Path = PathItem.extend(/** @lends Path# */{
return null;
},
toPath: '#clone',
_hitTestSelf: function(point, options) {
var that = this,
style = this.getStyle(),