|
@@ -15,10 +15,6 @@ namespace PixiEditor.Models.DocumentModels;
|
|
|
#nullable enable
|
|
|
internal class ActionAccumulator
|
|
|
{
|
|
|
- private const long minMsPerUpdate = 1000 / 60;
|
|
|
- private Stopwatch updateStopwatch = Stopwatch.StartNew();
|
|
|
- private long lastUpdateMs = 0;
|
|
|
-
|
|
|
private bool executing = false;
|
|
|
|
|
|
private List<IAction> queuedActions = new();
|
|
@@ -65,13 +61,6 @@ internal class ActionAccumulator
|
|
|
|
|
|
while (queuedActions.Count > 0)
|
|
|
{
|
|
|
- // wait to limit update rate
|
|
|
- long currentMillis = updateStopwatch.ElapsedMilliseconds;
|
|
|
- long waitDuration = minMsPerUpdate - (currentMillis - lastUpdateMs);
|
|
|
- if (waitDuration > 0)
|
|
|
- await Task.Delay((int)waitDuration);
|
|
|
- lastUpdateMs = updateStopwatch.ElapsedMilliseconds;
|
|
|
-
|
|
|
// select actions to be processed
|
|
|
var toExecute = queuedActions;
|
|
|
queuedActions = new List<IAction>();
|