From 3bfb00a3298e3748b598fd721f3f2ba2e2440f51 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 14 Jul 2025 10:51:53 +0200 Subject: [PATCH] cleanup GitOrigin-RevId: 65c4fe7b75739f84a1e05bb9dec8f447c2fd770e --- .../src/com/intellij/util/ui/Animator.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/platform-api/src/com/intellij/util/ui/Animator.kt b/platform/platform-api/src/com/intellij/util/ui/Animator.kt index d21d7e1ff408..d1a725a6f0d5 100644 --- a/platform/platform-api/src/com/intellij/util/ui/Animator.kt +++ b/platform/platform-api/src/com/intellij/util/ui/Animator.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.util.ui import com.intellij.codeWithMe.ClientId @@ -38,8 +38,14 @@ abstract class Animator @JvmOverloads constructor( isRepeatable: Boolean, isForward: Boolean = true, disposable: Disposable, - ) : this(name = name, totalFrames = totalFrames, cycleDuration = cycleDuration, isRepeatable = isRepeatable, isForward = isForward, - coroutineScope = animatorCoroutineScope(name, disposable)) + ) : this( + name = name, + totalFrames = totalFrames, + cycleDuration = cycleDuration, + isRepeatable = isRepeatable, + isForward = isForward, + coroutineScope = animatorCoroutineScope(name, disposable), + ) @Obsolete fun isForward(): Boolean = isForward @@ -56,7 +62,7 @@ abstract class Animator @JvmOverloads constructor( } /** - * This operation is used for manual processing of animation in cases when IDE event queue is unavailable + * This operation is used for manual processing of animation in cases when the IDE event queue is unavailable */ @ApiStatus.Internal fun forceTick() { @@ -204,7 +210,7 @@ private fun skipAnimation(): Boolean { private fun animatorCoroutineScopeWithError(name: String?): CoroutineScope { val realName = name ?: getCallerClassName() logger().error("Do not use repeatable animators without an explicit lifetime scope. " + - "An explicit Disposable would at least let us to log memory leaks and runaway tasks.") + "An explicit Disposable would at least let us log memory leaks and runaway tasks.") return CoroutineScope(SupervisorJob() + Dispatchers.Default + ModalityState.defaultModalityState().asContextElement() +