From dff0df4ce3687368d7e80066eb54476b139191bb Mon Sep 17 00:00:00 2001 From: HEIHUAa <112499486+HEIHUAa@users.noreply.github.com> Date: Mon, 20 Apr 2026 04:40:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20UIScrollBar.hx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/funkin/editors/ui/UIScrollBar.hx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/funkin/editors/ui/UIScrollBar.hx b/source/funkin/editors/ui/UIScrollBar.hx index b94f4cd548..7311578d28 100644 --- a/source/funkin/editors/ui/UIScrollBar.hx +++ b/source/funkin/editors/ui/UIScrollBar.hx @@ -29,6 +29,8 @@ class UIScrollBar extends UISprite { thumbIcon = new FlxSprite(0, 0, Paths.image('editors/ui/scrollbar-icon')); members.push(thumbIcon); + + FlxG.stage.window.onFocusOut.add(onWindowFocusOut); } public var isScrolling:Bool = false; @@ -61,4 +63,15 @@ class UIScrollBar extends UISprite { thumb.framesOffset = lastHoveredThumb ? 9 : 0; } } + + public override function destroy() { + FlxG.stage.window.onFocusOut.remove(onWindowFocusOut); + super.destroy(); + } + + private function onWindowFocusOut():Void { + isScrolling = false; + hovered = false; + thumb.hovered = false; + } } \ No newline at end of file