From e1efd09378a9720fa71edf9612457c65781f3ce5 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Thu, 22 Dec 2016 10:01:41 +0800 Subject: [PATCH] rename some variables --- cocos2d/core/components/CCLabel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos2d/core/components/CCLabel.js b/cocos2d/core/components/CCLabel.js index 6eb30f3e54..deab2ab855 100644 --- a/cocos2d/core/components/CCLabel.js +++ b/cocos2d/core/components/CCLabel.js @@ -373,12 +373,12 @@ var Label = cc.Class({ } var isAsset = value instanceof cc.Font; - var fntRawUrl = isAsset ? value.rawUrl : ''; if (this.font instanceof cc.BitmapFont) { this._sgNode.setFontFileOrFamily(this.font.fntDataStr, this.font.spriteFrame); } else { - this._sgNode.setFontFileOrFamily(fntRawUrl); + var ttfName = isAsset ? value.rawUrl : ''; + this._sgNode.setFontFileOrFamily(ttfName); } } @@ -466,14 +466,14 @@ var Label = cc.Class({ } var isAsset = this.font instanceof cc.Font; - var fntRawUrl = isAsset ? this.font.rawUrl : ''; var sgNode; if (this.font instanceof cc.BitmapFont) { this._bmFontOriginalSize = this.font.fontSize; sgNode = this._sgNode = new _ccsg.Label(this.string, this.font.fntDataStr, this.font.spriteFrame); } else { - sgNode = this._sgNode = new _ccsg.Label(this.string, fntRawUrl); + var ttfName = isAsset ? this.font.rawUrl : ''; + sgNode = this._sgNode = new _ccsg.Label(this.string, ttfName); } if (CC_JSB) {