Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add rotation offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 19, 2023
1 parent 1fdaa80 commit 18fc442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,10 @@ private bool DrawGeneralTab(DrawingSettings settings)
ImGui.DragFloat("Size per second", ref settings.SizePerSecond, 0.3f, 20, 150);
DrawHelper.SetTooltip("This is the width of every second drawn on the window.");

if (!settings.IsRotation)
{
ImGui.DragInt("Offset Time (seconds)", ref settings.TimeOffsetSetting, 0.1f, 0, 10);
DrawHelper.SetTooltip("This is the advanced time about action using");
}
ImGui.DragInt("Offset Time (seconds)", ref settings.TimeOffsetSetting, 0.1f, 0, 1000);
DrawHelper.SetTooltip(settings.IsRotation ? "The Offset time of rotation."
: "This is the advanced time about action using");

ImGui.DragFloat("Drawing Center offset", ref settings.CenterOffset, 0.3f, -500, 500);

return result;
Expand Down
2 changes: 1 addition & 1 deletion ActionTimelineEx/Windows/TimelineWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private static void DrawContent(DrawingSettings setting)
var pos = ImGui.GetWindowPos();
var size = ImGui.GetWindowSize();

var now = setting.IsRotation ? TimelineManager.Instance?.EndTime ?? DateTime.Now : DateTime.Now;
var now = setting.IsRotation ? (TimelineManager.Instance?.EndTime ?? DateTime.Now - TimeSpan.FromSeconds(setting.TimeOffsetSetting)) : DateTime.Now;

var endTime = now - TimeSpan.FromSeconds(size.X / setting.SizePerSecond - setting.TimeOffset);

Expand Down

0 comments on commit 18fc442

Please sign in to comment.