mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
Make cascade opacity actually working (#2828)
This commit is contained in:
@@ -905,10 +905,7 @@ var Node = cc.Class({
|
||||
set (value) {
|
||||
if (this._opacity !== value) {
|
||||
this._opacity = value;
|
||||
|
||||
if (this._renderComponent) {
|
||||
this._renderFlag |= RenderFlow.FLAG_COLOR;
|
||||
}
|
||||
this._renderFlag |= RenderFlow.FLAG_COLOR;
|
||||
}
|
||||
},
|
||||
range: [0, 255]
|
||||
|
||||
@@ -70,7 +70,8 @@ _proto._worldTransform = function (node) {
|
||||
};
|
||||
|
||||
_proto._color = function (node) {
|
||||
_walker.parentOpacityDirty ++;
|
||||
let opacityLevel = (node._opacity < 255) ? 1 : 0;
|
||||
_walker.parentOpacityDirty += opacityLevel;
|
||||
|
||||
let comp = node._renderComponent;
|
||||
if (comp) {
|
||||
@@ -81,7 +82,7 @@ _proto._color = function (node) {
|
||||
}
|
||||
this._next._func(node);
|
||||
|
||||
_walker.parentOpacityDirty --;
|
||||
_walker.parentOpacityDirty -= opacityLevel;
|
||||
};
|
||||
|
||||
_proto._updateRenderData = function (node) {
|
||||
|
||||
Reference in New Issue
Block a user