From e8390a76d8e3cba3673c5454b80a54d641e62efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 9 Jan 2016 12:08:47 +0100 Subject: [PATCH] Define Path#toShape() and Shape#toPath() as aliases to #clone(). --- src/basic/Point.js | 1 - src/item/Shape.js | 2 ++ src/path/Path.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/basic/Point.js b/src/basic/Point.js index 24f5e625..d9553209 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -1,4 +1,3 @@ - /* * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ diff --git a/src/item/Shape.js b/src/item/Shape.js index 8d5b7a89..89a90817 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -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(), diff --git a/src/path/Path.js b/src/path/Path.js index 04031695..b0a95709 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1522,6 +1522,8 @@ var Path = PathItem.extend(/** @lends Path# */{ return null; }, + toPath: '#clone', + _hitTestSelf: function(point, options) { var that = this, style = this.getStyle(),