Skip to content

Commit 75a2ecb

Browse files
committed
fix: cancel in-flight fade-out animation before setting HUD alpha
1 parent ce66ffd commit 75a2ecb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

VolumeGrid/HUD/HUDManager.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,13 @@ class HUDManager {
436436
hudWindow.animator().alphaValue = VolumeGridConstants.HUD.alpha
437437
}, completionHandler: nil)
438438
} else {
439+
// Cancel any in-flight fade-out animation before setting alpha
440+
NSAnimationContext.runAnimationGroup(
441+
{ context in
442+
context.duration = 0
443+
hudWindow.animator().alphaValue = VolumeGridConstants.HUD.alpha
444+
}, completionHandler: nil)
439445
hudWindow.orderFrontRegardless()
440-
hudWindow.alphaValue = VolumeGridConstants.HUD.alpha
441446
}
442447
}
443448

0 commit comments

Comments
 (0)