From cf503cf92154283374d91a898e7dc84c1a29a757 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Tue, 12 Aug 2025 21:03:35 -0500 Subject: [PATCH 1/2] Add material instance ctor for `MaterialBrush` --- Source/Engine/UI/GUI/Brushes/MaterialBrush.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs b/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs index 6210ca2d0..423e5ad70 100644 --- a/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs +++ b/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs @@ -29,6 +29,14 @@ namespace FlaxEngine.GUI { Material = material; } + /// + /// Initializes a new instance of the struct. + /// + /// The material. + public MaterialBrush(MaterialInstance material) + { + Material = material; + } /// public Float2 Size => Float2.One; From 38b4ace1a85b90e7f5b31c2abcceeb3f43729406 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 15 Aug 2025 07:01:48 -0500 Subject: [PATCH 2/2] Use material base as ctor parameter. --- Source/Engine/UI/GUI/Brushes/MaterialBrush.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs b/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs index 423e5ad70..13e9dab24 100644 --- a/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs +++ b/Source/Engine/UI/GUI/Brushes/MaterialBrush.cs @@ -25,15 +25,7 @@ namespace FlaxEngine.GUI /// Initializes a new instance of the struct. /// /// The material. - public MaterialBrush(Material material) - { - Material = material; - } - /// - /// Initializes a new instance of the struct. - /// - /// The material. - public MaterialBrush(MaterialInstance material) + public MaterialBrush(MaterialBase material) { Material = material; }