diff --git a/cocos/scripting/js-bindings/script/jsb_cocos2d.js b/cocos/scripting/js-bindings/script/jsb_cocos2d.js index 62c4e3abc097..9a78f0bdef20 100644 --- a/cocos/scripting/js-bindings/script/jsb_cocos2d.js +++ b/cocos/scripting/js-bindings/script/jsb_cocos2d.js @@ -1779,7 +1779,7 @@ cc._DrawNode.prototype.drawPoly = function (verts, fillColor, borderWidth, borde cc._DrawNode.prototype.drawPolygon.call(this, verts, verts.length, fillColor, borderWidth, borderColor); } cc.DrawNode = cc._DrawNode.extend({ - _drawColor: cc.color(255, 255, 255, 255), + _drawColor: null, _lineWidth: 1, release: function () {}, @@ -1895,7 +1895,9 @@ cc.DrawNode = cc._DrawNode.extend({ cc._DrawNode.prototype.drawDot.call(this, pos, radius, color); }, - drawSegment:function (from, to, lineWidth = this._lineWidth, color = this._drawColor) { + drawSegment:function (from, to, lineWidth, color) { + lineWidth = lineWidth || this._lineWidth; + color = color || this._drawColor; cc._DrawNode.prototype.drawSegment.call(this, from, to, lineWidth, color); }, diff --git a/cocos/scripting/js-bindings/script/jsb_create_apis.js b/cocos/scripting/js-bindings/script/jsb_create_apis.js index 8946bcb7f062..ec0f38501c34 100644 --- a/cocos/scripting/js-bindings/script/jsb_create_apis.js +++ b/cocos/scripting/js-bindings/script/jsb_create_apis.js @@ -774,6 +774,7 @@ cc.ClippingNode.prototype._ctor = function(stencil) { cc.DrawNode.prototype._ctor = function() { cc.DrawNode.prototype.init.call(this); + this._drawColor = cc.color(255, 255, 255, 255); }; cc.LabelAtlas.prototype._ctor = function(strText, charMapFile, itemWidth, itemHeight, startCharMap) {