mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Layer brush/effect dialogs - Fixed default location
Layer properties - Give it a best effort to avoid null base values
This commit is contained in:
1 parent
af496da647
commit
8066586328
5 files changed
+53
-31
No files matched your search
@@ -34,7 +34,15 @@ namespace Artemis.Core
|
||||
CurrentValue = default!;
|
||||
DefaultValue = default!;
|
||||
|
||||
_baseValue = typeof(T).IsValueType ? default! : Activator.CreateInstance<T>();
|
||||
// We'll try our best...
|
||||
// TODO: Consider alternatives
|
||||
if (typeof(T).IsValueType)
|
||||
_baseValue = default!;
|
||||
else if (typeof(T).GetConstructor(Type.EmptyTypes) != null)
|
||||
_baseValue = Activator.CreateInstance<T>();
|
||||
else
|
||||
_baseValue = default!;
|
||||
|
||||
_keyframes = new List<LayerPropertyKeyframe<T>>();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user