@@ -181,7 +181,7 @@ cc.DrawNodeCanvas = cc.Node.extend(/** @lends cc.DrawNode# */{
181
181
* @param {cc.Color } lineColor
182
182
*/
183
183
drawRect : function ( origin , destination , fillColor , lineWidth , lineColor ) {
184
- lineWidth = lineWidth || this . _lineWidth ;
184
+ lineWidth = ( lineWidth == null ) ? this . _lineWidth : lineWidth ;
185
185
lineColor = lineColor || this . getDrawColor ( ) ;
186
186
if ( lineColor . a == null )
187
187
lineColor . a = 255 ;
@@ -436,7 +436,7 @@ cc.DrawNodeCanvas = cc.Node.extend(/** @lends cc.DrawNode# */{
436
436
* @param {cc.Color } color
437
437
*/
438
438
drawPoly_ : function ( verts , fillColor , lineWidth , color ) {
439
- lineWidth = lineWidth || this . _lineWidth ;
439
+ lineWidth = ( lineWidth == null ) ? this . _lineWidth : lineWidth ;
440
440
color = color || this . getDrawColor ( ) ;
441
441
if ( color . a == null )
442
442
color . a = 255 ;
@@ -554,7 +554,7 @@ cc.DrawNodeWebGL = cc.Node.extend({
554
554
} ,
555
555
556
556
drawRect : function ( origin , destination , fillColor , lineWidth , lineColor ) {
557
- lineWidth = lineWidth || this . _lineWidth ;
557
+ lineWidth = ( lineWidth == null ) ? this . _lineWidth : lineWidth ;
558
558
lineColor = lineColor || this . getDrawColor ( ) ;
559
559
if ( lineColor . a == null )
560
560
lineColor . a = 255 ;
@@ -789,7 +789,7 @@ cc.DrawNodeWebGL = cc.Node.extend({
789
789
fillColor . a = 255 ;
790
790
if ( borderColor . a == null )
791
791
borderColor . a = 255 ;
792
- borderWidth = borderWidth || this . _lineWidth ;
792
+ borderWidth = ( borderWidth == null ) ? this . _lineWidth : borderWidth ;
793
793
borderWidth *= 0.5 ;
794
794
var c4bFillColor = { r : 0 | fillColor . r , g : 0 | fillColor . g , b : 0 | fillColor . b , a : 0 | fillColor . a } ;
795
795
var c4bBorderColor = { r : 0 | borderColor . r , g : 0 | borderColor . g , b : 0 | borderColor . b , a : 0 | borderColor . a } ;
@@ -852,7 +852,7 @@ cc.DrawNodeWebGL = cc.Node.extend({
852
852
} ,
853
853
854
854
_drawSegments : function ( verts , borderWidth , borderColor , closePoly ) {
855
- borderWidth = borderWidth || this . _lineWidth ;
855
+ borderWidth = ( borderWidth == null ) ? this . _lineWidth : borderWidth ;
856
856
borderColor = borderColor || this . _drawColor ;
857
857
if ( borderColor . a == null )
858
858
borderColor . a = 255 ;
0 commit comments