Skip to content

Commit 5a40dca

Browse files
committed
Merge pull request #2767 from VisualSJ/develop-scale9Sprite
Fixed #2753: Background color of panel from cocos studio 2 doesnt work
2 parents ddc8b22 + a5db17e commit 5a40dca

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

extensions/cocostudio/loader/parsers/timelineParser-2.x.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,12 @@
422422

423423
}
424424

425-
var bgStartColor = json["FirstColor"];
426-
var bgEndColor = json["EndColor"];
427-
if(bgStartColor != null && bgEndColor != null){
428-
var startC = getColor(bgStartColor);
429-
if(bgEndColor["R"] == null && bgEndColor["G"] == null && bgEndColor["B"] == null)
430-
widget.setBackGroundColor( startC );
431-
else
432-
widget.setBackGroundColor( startC, getColor(bgEndColor) );
433-
}
425+
var firstColor = json["FirstColor"];
426+
var endColor = json["EndColor"];
427+
if(endColor["R"] != null && endColor["G"] != null && endColor["B"] != null)
428+
widget.setBackGroundColor(getColor(firstColor), getColor(endColor));
429+
else
430+
widget.setBackGroundColor(getColor(json["SingleColor"]));
434431

435432
var colorVector = json["ColorVector"];
436433
if(colorVector != null)

0 commit comments

Comments
 (0)