From 27d7e7a07afd003cf33d93396b50105548cce08d Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Thu, 8 Jun 2017 15:14:28 +0800 Subject: [PATCH] fix clone SpriteFrame on native --- jsb/jsb-tex-sprite-frame.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jsb/jsb-tex-sprite-frame.js b/jsb/jsb-tex-sprite-frame.js index 85a030823d..09914e8b8e 100644 --- a/jsb/jsb-tex-sprite-frame.js +++ b/jsb/jsb-tex-sprite-frame.js @@ -268,6 +268,17 @@ prototype.getTexture = function () { return tex; }; +prototype._clone = prototype.clone; +prototype.clone = function () { + var cloned = this._clone(); + cloned._name = this._name; + cloned.insetTop = this.insetTop; + cloned.insetBottom = this.insetBottom; + cloned.insetLeft = this.insetLeft; + cloned.insetRight = this.insetRight; + return cloned; +}; + cc.js.set(prototype, '_textureFilenameSetter', function (url) { this._textureFilename = url; if (url) {