1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-30 22:29:56 +00:00

Corrects execution cap for splitAndSync ticks.

This commit is contained in:
Thomas Harte 2020-03-22 19:25:02 -04:00
parent e6bae261c4
commit 72103a4adb
2 changed files with 4 additions and 3 deletions

View File

@ -748,8 +748,8 @@ class MachineDocument:
func openGLViewDidShowOSMouseCursor(_ view: CSOpenGLView) {
// The OS mouse cursor became visible, so show the volume controls.
volumeView.layer?.removeAllAnimations()
animationFader = nil
volumeView.layer?.removeAllAnimations()
volumeView.isHidden = false
volumeView.layer?.opacity = 1.0
}

View File

@ -779,9 +779,10 @@ struct ActivityObserver: public Activity::Observer {
_timer = [[CSHighPrecisionTimer alloc] initWithTask:^{
// Grab the time now and, therefore, the amount of time since the timer last fired
// (capped at half a second).
// (subject to a cap to avoid potential perpetual regression).
const auto timeNow = Time::nanos_now();
const auto duration = std::min(timeNow - lastTime, Time::Nanos(10'000'000'000 / TICKS));
lastTime = std::max(timeNow - Time::Nanos(10'000'000'000 / TICKS), lastTime);
const auto duration = timeNow - lastTime;
CGSize pixelSize;
BOOL splitAndSync = NO;