Pārlūkot izejas kodu

Fixed animations

Nikita Tsukanov 2 gadi atpakaļ
vecāks
revīzija
e9ca33d283
1 mainītis faili ar 10 papildinājumiem un 3 dzēšanām
  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)
             if (_scheduleCommitOnLastCompositionBatchCompletion)
             {
             {
                 _scheduleCommitOnLastCompositionBatchCompletion = false;
                 _scheduleCommitOnLastCompositionBatchCompletion = false;
-                CommitCompositorsWithThrottling();
+                if (!CommitCompositorsWithThrottling())
+                    ScheduleRenderForAnimationsIfNeeded();
+
             }
             }
             // Check if there are active animations and schedule the next render
             // 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>
     /// <summary>