Skip to content

Commit

Permalink
Merge pull request #1199 from zringhost11/LayaAir_3.0.0
Browse files Browse the repository at this point in the history
:Fix the bug that synchronization of disabled and gray of UIComponent causes ide to be unable to update properties separately
  • Loading branch information
xiaoguzhu authored Aug 31, 2023
2 parents ac7c070 + 3e73d98 commit 6a8f7e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/layaAir/laya/ui/UIComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
* <code>Component</code> 是ui控件类的基类。
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/layaAir/laya/webgl/shader/d2/value/Value2D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 6a8f7e0

Please # to comment.