mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Profiles - Fix brush properties being carried over from previous brush
This commit is contained in:
1 parent
3625d1ad11
commit
eec2419005
5 files changed
+18
-8
No files matched your search
@@ -793,8 +793,7 @@ namespace Artemis.Core
|
||||
|
||||
General.BrushReference.SetCurrentValue(layerBrush != null ? new LayerBrushReference(layerBrush.Descriptor) : null, null);
|
||||
LayerBrush = layerBrush;
|
||||
LayerEntity.LayerBrush = new LayerBrushEntity();
|
||||
|
||||
|
||||
oldLayerBrush?.InternalDisable();
|
||||
|
||||
if (LayerBrush != null)
|
||||
|
||||
@@ -235,9 +235,20 @@ namespace Artemis.Core
|
||||
if (_disposed)
|
||||
throw new ObjectDisposedException("LayerProperty");
|
||||
|
||||
string json = CoreJson.SerializeObject(DefaultValue, true);
|
||||
if (DefaultValue == null)
|
||||
return;
|
||||
|
||||
KeyframesEnabled = false;
|
||||
SetCurrentValue(CoreJson.DeserializeObject<T>(json)!, null);
|
||||
|
||||
// For value types there's no need to make a copy
|
||||
if (DefaultValue.GetType().IsValueType)
|
||||
SetCurrentValue(DefaultValue);
|
||||
// Reference types make a deep clone (ab)using JSON
|
||||
else
|
||||
{
|
||||
string json = CoreJson.SerializeObject(DefaultValue, true);
|
||||
SetCurrentValue(CoreJson.DeserializeObject<T>(json)!);
|
||||
}
|
||||
}
|
||||
|
||||
internal void ReapplyUpdate()
|
||||
|
||||
Reference in new issue
Block a user