Skip to content

Commit adeea52

Browse files
committed
Reverted unnecessary changes
1 parent 664dd15 commit adeea52

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

  • engine/Sandbox.Engine/Systems/UI/Controls

engine/Sandbox.Engine/Systems/UI/Controls/Image.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)