File tree Expand file tree Collapse file tree
engine/Sandbox.Engine/Systems/UI/Controls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,17 +9,7 @@ public partial class Image : Panel
99 /// <summary>
1010 /// The texture being displayed by this panel.
1111 /// </summary>
12- [ Property ]
13- public Texture Texture
14- {
15- get ;
16- set
17- {
18- if ( field == value ) return ;
19- field = value ;
20- YogaNode . MarkDirty ( ) ;
21- }
22- }
12+ public Texture Texture { get ; set ; }
2313
2414 public override bool HasContent => Texture != null ;
2515
@@ -33,10 +23,14 @@ public Image()
3323 /// </summary>
3424 public async void SetTexture ( string name )
3525 {
26+ Log . Info ( $ "Image.SetTexture: { name } " ) ;
3627 if ( string . IsNullOrWhiteSpace ( name ) ) return ;
3728 if ( ! IsValid ) return ;
3829
3930 Texture = await Texture . LoadAsync ( name ) ;
31+
32+ if ( ! IsValid ) return ;
33+ YogaNode . MarkDirty ( ) ; // Update MeasureTexture
4034 }
4135
4236 float oldScaleToScreen = 1.0f ;
You can’t perform that action at this time.
0 commit comments