mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Core - Create default instances for properties
UI - Added configurable width/height for brush dialogs
This commit is contained in:
1 parent
f4e3011957
commit
903e434137
12 files changed
+109
-14
No files matched your search
@@ -9,6 +9,7 @@
|
||||
RegisterDataBindingProperty(() => CurrentValue.End, value => CurrentValue.End = value, new FloatDataBindingConverter<FloatRange>(), "End");
|
||||
|
||||
CurrentValueSet += OnCurrentValueSet;
|
||||
DefaultValue = new FloatRange();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -25,7 +26,7 @@
|
||||
private void OnCurrentValueSet(object? sender, LayerPropertyEventArgs e)
|
||||
{
|
||||
// Don't allow the int range to be null
|
||||
BaseValue ??= DefaultValue ?? new FloatRange(0, 0);
|
||||
BaseValue ??= DefaultValue ?? new FloatRange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
RegisterDataBindingProperty(() => CurrentValue.End, value => CurrentValue.End = value, new IntDataBindingConverter<IntRange>(), "End");
|
||||
|
||||
CurrentValueSet += OnCurrentValueSet;
|
||||
DefaultValue = new IntRange();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -25,7 +26,7 @@
|
||||
private void OnCurrentValueSet(object? sender, LayerPropertyEventArgs e)
|
||||
{
|
||||
// Don't allow the int range to be null
|
||||
BaseValue ??= DefaultValue ?? new IntRange(0, 0);
|
||||
BaseValue ??= DefaultValue ?? new IntRange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,14 @@ namespace Artemis.Core
|
||||
{
|
||||
private readonly Random _rand;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="FloatRange" /> class
|
||||
/// </summary>
|
||||
public FloatRange()
|
||||
{
|
||||
_rand = new Random();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="FloatRange" /> class
|
||||
/// </summary>
|
||||
|
||||
@@ -9,6 +9,14 @@ namespace Artemis.Core
|
||||
{
|
||||
private readonly Random _rand;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="IntRange" /> class
|
||||
/// </summary>
|
||||
public IntRange()
|
||||
{
|
||||
_rand = new Random();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="IntRange" /> class
|
||||
/// </summary>
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Artemis.Core
|
||||
CurrentValue = default!;
|
||||
DefaultValue = default!;
|
||||
|
||||
_baseValue = default!;
|
||||
_baseValue = typeof(T).IsValueType ? default! : Activator.CreateInstance<T>();
|
||||
_keyframes = new List<LayerPropertyKeyframe<T>>();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user