From a8b3e5a2833a05deb62a7663373bc52b5dc6ce84 Mon Sep 17 00:00:00 2001 From: JoneLau <32630749+JoneLau@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:12:45 +0800 Subject: [PATCH] fix bug (#4559) 1. fix button interactable no effect in runtime 2. fix label initial string length to 0 without rendering --- cocos/3d/ui/components/button-component.ts | 2 +- cocos/3d/ui/components/label-component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/3d/ui/components/button-component.ts b/cocos/3d/ui/components/button-component.ts index ea49fd2af8..9a1a6b1e8d 100644 --- a/cocos/3d/ui/components/button-component.ts +++ b/cocos/3d/ui/components/button-component.ts @@ -709,7 +709,7 @@ export class ButtonComponent extends Component { return; } - if (CC_EDITOR) { + if (CC_EDITOR || state === State.DISABLED) { renderComp.color = color; } else { this._fromColor = renderComp.color.clone(); diff --git a/cocos/3d/ui/components/label-component.ts b/cocos/3d/ui/components/label-component.ts index 28fe0a8dc6..4ed7d84fbc 100644 --- a/cocos/3d/ui/components/label-component.ts +++ b/cocos/3d/ui/components/label-component.ts @@ -178,8 +178,8 @@ export class LabelComponent extends UIRenderComponent { } this._string = value; - this.updateRenderData(); this._checkStringEmpty(); + this.updateRenderData(); } /**