mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Profile editor - Fixed segment length dialog this closes #523
This commit is contained in:
parent
30c4314f1d
commit
52906218dc
@ -8,7 +8,7 @@
|
||||
<Product>Artemis</Product>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Description>Provides advanced unified lighting across many different brands RGB peripherals</Description>
|
||||
<Copyright>Copyright © Robert Beekman - 2020</Copyright>
|
||||
<Copyright>Copyright © Robert Beekman - 2021</Copyright>
|
||||
<FileVersion>2.0.0.0</FileVersion>
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<UseWPF>true</UseWPF>
|
||||
|
||||
@ -327,28 +327,35 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
|
||||
newTime = TimeSpan.FromMilliseconds(Math.Round(newTime.TotalMilliseconds / 50.0) * 50.0);
|
||||
}
|
||||
|
||||
UpdateLength(newTime);
|
||||
UpdateEndPosition(newTime);
|
||||
}
|
||||
|
||||
public void UpdateLength(TimeSpan newTime)
|
||||
public void UpdateEndPosition(TimeSpan end)
|
||||
{
|
||||
if (newTime < TimeSpan.FromMilliseconds(100))
|
||||
newTime = TimeSpan.FromMilliseconds(100);
|
||||
if (end < TimeSpan.FromMilliseconds(100))
|
||||
end = TimeSpan.FromMilliseconds(100);
|
||||
|
||||
if (Segment == SegmentViewModelType.Start)
|
||||
SelectedProfileElement.Timeline.StartSegmentEndPosition = end;
|
||||
else if (Segment == SegmentViewModelType.Main)
|
||||
SelectedProfileElement.Timeline.MainSegmentEndPosition = end;
|
||||
else if (Segment == SegmentViewModelType.End)
|
||||
SelectedProfileElement.Timeline.EndSegmentEndPosition = end;
|
||||
|
||||
TimeSpan difference = newTime - SegmentEnd;
|
||||
Update();
|
||||
}
|
||||
|
||||
if (difference > TimeSpan.Zero)
|
||||
ShiftNextSegment(difference);
|
||||
public void UpdateLength(TimeSpan length)
|
||||
{
|
||||
if (length < TimeSpan.FromMilliseconds(100))
|
||||
length = TimeSpan.FromMilliseconds(100);
|
||||
|
||||
if (Segment == SegmentViewModelType.Start)
|
||||
SelectedProfileElement.Timeline.StartSegmentEndPosition = newTime;
|
||||
SelectedProfileElement.Timeline.StartSegmentLength = length;
|
||||
else if (Segment == SegmentViewModelType.Main)
|
||||
SelectedProfileElement.Timeline.MainSegmentEndPosition = newTime;
|
||||
SelectedProfileElement.Timeline.MainSegmentLength = length;
|
||||
else if (Segment == SegmentViewModelType.End)
|
||||
SelectedProfileElement.Timeline.EndSegmentEndPosition = newTime;
|
||||
|
||||
if (difference < TimeSpan.Zero)
|
||||
ShiftNextSegment(difference);
|
||||
SelectedProfileElement.Timeline.EndSegmentLength = length;
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user