mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fix opacity bug (#8504)
This commit is contained in:
@@ -470,7 +470,7 @@ export class Renderable2D extends RenderableComponent {
|
||||
|
||||
protected _updateWorldAlpha () {
|
||||
const localAlpha = this.color.a / 255;
|
||||
this.node._uiProps.opacity = this.node.parent ? this.node.parent._uiProps.opacity * localAlpha : localAlpha;
|
||||
this.node._uiProps.opacity = (this.node.parent && this.node.parent._uiProps) ? this.node.parent._uiProps.opacity * localAlpha : localAlpha;
|
||||
this._renderFlag = this._canRender();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user