Skip to content

Commit fb6dd79

Browse files
author
SeanLin
committed
Merge pull request #588 from dingpinglv/iss1509_UpdateMenuTest
fixed #1509 correct cc.LayerGradient's effect
2 parents 63abea4 + 3c5105a commit fb6dd79

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

cocos2d/layers_scenes_transitions_nodes/CCLayer.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -663,28 +663,28 @@ cc.LayerGradient = cc.LayerColor.extend(/** @lends cc.LayerGradient# */{
663663
context_render.scale(layerWidth, layerHeight);
664664

665665
// Top-left,
666-
data[ 0 ] = 0 | (this._squareColors[0].r * 255);
667-
data[ 1 ] = 0 | (this._squareColors[0].g * 255);
668-
data[ 2 ] = 0 | (this._squareColors[0].b * 255);
669-
data[ 3 ] = 0 | (this._squareColors[0].a * 255);
666+
data[ 0 ] = 0 | (this._squareColors[2].r * 255);
667+
data[ 1 ] = 0 | (this._squareColors[2].g * 255);
668+
data[ 2 ] = 0 | (this._squareColors[2].b * 255);
669+
data[ 3 ] = 0 | (this._squareColors[2].a * 255);
670670

671671
// Top-right,
672-
data[ 4 ] = 0 | (this._squareColors[1].r * 255);
673-
data[ 5 ] = 0 | (this._squareColors[1].g * 255);
674-
data[ 6 ] = 0 | (this._squareColors[1].b * 255);
675-
data[ 7 ] = 0 | (this._squareColors[1].a * 255);
672+
data[ 4 ] = 0 | (this._squareColors[3].r * 255);
673+
data[ 5 ] = 0 | (this._squareColors[3].g * 255);
674+
data[ 6 ] = 0 | (this._squareColors[3].b * 255);
675+
data[ 7 ] = 0 | (this._squareColors[3].a * 255);
676676

677677
// Bottom-left,
678-
data[ 8 ] = 0 | (this._squareColors[2].r * 255);
679-
data[ 9 ] = 0 | (this._squareColors[2].g * 255);
680-
data[ 10 ] = 0 | (this._squareColors[2].b * 255);
681-
data[ 11 ] = 0 | (this._squareColors[2].a * 255);
678+
data[ 8 ] = 0 | (this._squareColors[0].r * 255);
679+
data[ 9 ] = 0 | (this._squareColors[0].g * 255);
680+
data[ 10 ] = 0 | (this._squareColors[0].b * 255);
681+
data[ 11 ] = 0 | (this._squareColors[0].a * 255);
682682

683683
// Bottom-right,
684-
data[ 12 ] = 0 | (this._squareColors[3].r * 255);
685-
data[ 13 ] = 0 | (this._squareColors[3].g * 255);
686-
data[ 14 ] = 0 | (this._squareColors[3].b * 255);
687-
data[ 15 ] = 0 | (this._squareColors[3].a * 255);
684+
data[ 12 ] = 0 | (this._squareColors[1].r * 255);
685+
data[ 13 ] = 0 | (this._squareColors[1].g * 255);
686+
data[ 14 ] = 0 | (this._squareColors[1].b * 255);
687+
data[ 15 ] = 0 | (this._squareColors[1].a * 255);
688688

689689
context_colors.putImageData(image_colors, 0, 0);
690690
context_render.drawImage(canvas_colors, 0, 0);
@@ -839,7 +839,7 @@ cc.LayerGradient = cc.LayerColor.extend(/** @lends cc.LayerGradient# */{
839839
this._endColor.b = end.b;
840840
this._endOpacity = end.a;
841841

842-
this.alongVector = v;
842+
this._alongVector = v;
843843

844844
this._compressedInterpolation = true;
845845

0 commit comments

Comments
 (0)