mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +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>
|
<Product>Artemis</Product>
|
||||||
<NeutralLanguage>en-US</NeutralLanguage>
|
<NeutralLanguage>en-US</NeutralLanguage>
|
||||||
<Description>Provides advanced unified lighting across many different brands RGB peripherals</Description>
|
<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>
|
<FileVersion>2.0.0.0</FileVersion>
|
||||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||||
<UseWPF>true</UseWPF>
|
<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);
|
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))
|
if (end < TimeSpan.FromMilliseconds(100))
|
||||||
newTime = TimeSpan.FromMilliseconds(100);
|
end = TimeSpan.FromMilliseconds(100);
|
||||||
|
|
||||||
TimeSpan difference = newTime - SegmentEnd;
|
|
||||||
|
|
||||||
if (difference > TimeSpan.Zero)
|
|
||||||
ShiftNextSegment(difference);
|
|
||||||
|
|
||||||
if (Segment == SegmentViewModelType.Start)
|
if (Segment == SegmentViewModelType.Start)
|
||||||
SelectedProfileElement.Timeline.StartSegmentEndPosition = newTime;
|
SelectedProfileElement.Timeline.StartSegmentEndPosition = end;
|
||||||
else if (Segment == SegmentViewModelType.Main)
|
else if (Segment == SegmentViewModelType.Main)
|
||||||
SelectedProfileElement.Timeline.MainSegmentEndPosition = newTime;
|
SelectedProfileElement.Timeline.MainSegmentEndPosition = end;
|
||||||
else if (Segment == SegmentViewModelType.End)
|
else if (Segment == SegmentViewModelType.End)
|
||||||
SelectedProfileElement.Timeline.EndSegmentEndPosition = newTime;
|
SelectedProfileElement.Timeline.EndSegmentEndPosition = end;
|
||||||
|
|
||||||
if (difference < TimeSpan.Zero)
|
Update();
|
||||||
ShiftNextSegment(difference);
|
}
|
||||||
|
|
||||||
|
public void UpdateLength(TimeSpan length)
|
||||||
|
{
|
||||||
|
if (length < TimeSpan.FromMilliseconds(100))
|
||||||
|
length = TimeSpan.FromMilliseconds(100);
|
||||||
|
|
||||||
|
if (Segment == SegmentViewModelType.Start)
|
||||||
|
SelectedProfileElement.Timeline.StartSegmentLength = length;
|
||||||
|
else if (Segment == SegmentViewModelType.Main)
|
||||||
|
SelectedProfileElement.Timeline.MainSegmentLength = length;
|
||||||
|
else if (Segment == SegmentViewModelType.End)
|
||||||
|
SelectedProfileElement.Timeline.EndSegmentLength = length;
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user