mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Synchronize some changes of 2d engine. (#7608)
This commit is contained in:
@@ -432,7 +432,7 @@ export class UIRenderable extends RenderableComponent {
|
||||
|
||||
protected _canRender () {
|
||||
// this.getMaterial(0) !== null still can render is hack for builtin Material
|
||||
return this.enabled && (this._delegateSrc ? this._delegateSrc.activeInHierarchy : this.enabledInHierarchy);
|
||||
return this.enabled && (this._delegateSrc ? this._delegateSrc.activeInHierarchy : this.enabledInHierarchy) && this._color.a > 0;
|
||||
}
|
||||
|
||||
protected _postCanRender () {}
|
||||
|
||||
@@ -276,6 +276,8 @@ export const graphicsAssembler: IAssembler = {
|
||||
end = pointsLength - 1;
|
||||
}
|
||||
|
||||
p1 = p1 || p0;
|
||||
|
||||
if (!loop) {
|
||||
// Add cap
|
||||
const dPos = new Point(p1.x, p1.y);
|
||||
|
||||
@@ -176,8 +176,6 @@ export const ttfUtils = {
|
||||
_isOutlined = true;
|
||||
_margin = _outlineWidth = outline.width;
|
||||
_outlineColor.set(outline.color);
|
||||
// TODO: temporary solution, cascade opacity for outline color
|
||||
_outlineColor.a = _outlineColor.a * comp.color.a / 255.0;
|
||||
}
|
||||
else {
|
||||
_isOutlined = false;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import { Component } from '../../core/components/component';
|
||||
import { ccclass, help, executeInEditMode, executionOrder, menu, editable, serializable } from 'cc.decorator';
|
||||
import { clampf } from '../../core/utils/misc';
|
||||
|
||||
/**
|
||||
* @en
|
||||
@@ -37,7 +38,7 @@ export class UIOpacity extends Component {
|
||||
if (this._opacity === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
value = clampf(value, 0, 255);
|
||||
this._opacity = value;
|
||||
this.node._uiProps.opacity = value / 255;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user