From ae697edde12f17888141d1ccfb4e941fbb1c4d8d Mon Sep 17 00:00:00 2001 From: zhuliang <38626955@qq.com> Date: Wed, 30 Aug 2023 15:46:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:Add=20protection=20for=20the=20bitmap?= =?UTF-8?q?=20in=20textureHost=20to=20prevent=20null=20pointer=20exception?= =?UTF-8?q?s.(=E5=A2=9E=E5=8A=A0=E5=AF=B9textureHost=E7=9A=84bitmap?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E6=8A=A4=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layaAir/laya/webgl/shader/d2/value/Value2D.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts b/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts index 979c269d16..5bf1eecc4e 100644 --- a/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts +++ b/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts @@ -117,7 +117,7 @@ export class Value2D { if (this.textureHost) { if (this.textureHost instanceof RenderTexture2D) { textrueReadGamma = (this.textureHost as RenderTexture2D).gammaCorrection != 1; - } else if (this.textureHost instanceof Texture) { + } else if (this.textureHost instanceof Texture && (this.textureHost as Texture).bitmap) { textrueReadGamma = (this.textureHost as Texture).bitmap.gammaCorrection != 1; } } From 3e73d98fee5f9ddc5c59c94817f4954fe9646c0c Mon Sep 17 00:00:00 2001 From: zhuliang <38626955@qq.com> Date: Thu, 31 Aug 2023 10:58:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:Fix=20the=20bug=20that=20synchronizatio?= =?UTF-8?q?n=20of=20disabled=20and=20gray=20of=20UIComponent=20causes=20id?= =?UTF-8?q?e=20to=20be=20unable=20to=20update=20properties=20separately.(?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DUIComponent=E7=9A=84disabled=E5=92=8Cgray?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=AF=BC=E8=87=B4ide=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=86=E5=BC=80=E6=9B=B4=E6=96=B0=E5=B1=9E=E6=80=A7=E7=9A=84?= =?UTF-8?q?bug)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layaAir/laya/ui/UIComponent.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layaAir/laya/ui/UIComponent.ts b/src/layaAir/laya/ui/UIComponent.ts index a0f94557f3..b268422ec2 100644 --- a/src/layaAir/laya/ui/UIComponent.ts +++ b/src/layaAir/laya/ui/UIComponent.ts @@ -5,6 +5,7 @@ import { Node } from "../display/Node" import { Sprite } from "../display/Sprite" import { Event } from "../events/Event" import { ILaya } from "../../ILaya"; +import { SerializeUtil } from "../loaders/SerializeUtil"; /** * Component 是ui控件类的基类。 @@ -327,7 +328,9 @@ export class UIComponent extends Sprite { set disabled(value: boolean) { if (value !== this._disabled) { - this.gray = this._disabled = value; + this._disabled = value; + if (!SerializeUtil.isDeserializing) + this.gray = value; this.mouseEnabled = !value; } }