Skip to content

Commit 4d86c34

Browse files
committed
Merge pull request #1574 from VisualSJ/develop-parser
Fixed #2753: Background color of panel from cocos studio 2 doesnt work
2 parents 621e014 + 545d8b5 commit 4d86c34

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

frameworks/js-bindings/bindings/script/studio/parsers/timelineParser-2.x.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,13 @@
411411
}
412412

413413
}
414-
415-
var bgStartColor = json["FirstColor"];
416-
var bgEndColor = json["EndColor"];
417-
if(bgStartColor != null && bgEndColor != null){
418-
var startC = getColor(bgStartColor);
419-
if(bgEndColor["R"] == null && bgEndColor["G"] == null && bgEndColor["B"] == null)
420-
widget.setBackGroundColor( startC );
421-
else
422-
widget.setBackGroundColor( startC, getColor(bgEndColor) );
423-
}
414+
415+
var firstColor = json["FirstColor"];
416+
var endColor = json["EndColor"];
417+
if(endColor["R"] != null && endColor["G"] != null && endColor["B"] != null)
418+
widget.setBackGroundColor(getColor(firstColor), getColor(endColor));
419+
else
420+
widget.setBackGroundColor(getColor(json["SingleColor"]));
424421

425422
var colorVector = json["ColorVector"];
426423
if(colorVector != null)

0 commit comments

Comments
 (0)