UI - Decreased device visualizer CPU usage

Keyframes - Snap to closest 50 ms while Ctrl is held down
This commit is contained in:
Robert committed 2021-04-17 10:22:33 +02:00
1 parent 651fc515d2
commit 5e345fed7c
8 files changed
+73 -62

No files matched your search

@@ -322,6 +322,9 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
false,
keyframeViewModels.Where(k => k != sourceKeyframeViewModel).Select(k => k.Position).ToList()
);
// If holding down control, round to the closest 50ms
else if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
cursorTime = TimeSpan.FromMilliseconds(Math.Round(cursorTime.TotalMilliseconds / 50.0) * 50.0);
sourceKeyframeViewModel.UpdatePosition(cursorTime);