Synchronize some changes of 2d engine. (#7608)

This commit is contained in:
cary
2020-10-28 12:08:24 +08:00
committed by GitHub
parent a318283a41
commit eaa0da71cc
4 changed files with 5 additions and 4 deletions
@@ -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);
-2
View File
@@ -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;
+2 -1
View File
@@ -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;
}