From 1a6cf72c7be3eb3f9b39e16756d1ce72777beefd Mon Sep 17 00:00:00 2001 From: Jackal Chan Date: Mon, 28 Oct 2024 00:44:30 +0800 Subject: [PATCH] Fix click event detection --- ImageWidgets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ImageWidgets.go b/ImageWidgets.go index 9a7dfd1f..d0fa1d5b 100644 --- a/ImageWidgets.go +++ b/ImageWidgets.go @@ -115,7 +115,7 @@ func (i *ImageWidget) Build() { } // trick: detect click event - if i.onClick != nil && IsMouseClicked(MouseButtonLeft) && IsWindowFocused(0) { + if i.onClick != nil && IsMouseClicked(MouseButtonLeft) && IsWindowHovered(0) { cursorPos := GetCursorScreenPos() mousePos := GetMousePos()