浏览代码

Fixed animations

Nikita Tsukanov 2 年之前
父节点
当前提交
e9ca33d283
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      src/Avalonia.Base/Media/MediaContext.Compositor.cs

+ 10 - 3
src/Avalonia.Base/Media/MediaContext.Compositor.cs

@@ -43,13 +43,20 @@ partial class MediaContext
             if (_scheduleCommitOnLastCompositionBatchCompletion)
             {
                 _scheduleCommitOnLastCompositionBatchCompletion = false;
-                CommitCompositorsWithThrottling();
+                if (!CommitCompositorsWithThrottling())
+                    ScheduleRenderForAnimationsIfNeeded();
+
             }
             // Check if there are active animations and schedule the next render
-            else if(_clock.HasSubscriptions) 
-                ScheduleRender(false);
+            else
+                ScheduleRenderForAnimationsIfNeeded();
         }
+    }
 
+    void ScheduleRenderForAnimationsIfNeeded()
+    {
+        if (_clock.HasSubscriptions) 
+            ScheduleRender(false);
     }
 
     /// <summary>