Skip to content

Commit

Permalink
Merge pull request AllenDang#894 from SleepyPrince/image-widget-oncli…
Browse files Browse the repository at this point in the history
…ck-fix

Fix image widget click event detection
  • Loading branch information
gucio321 authored Oct 29, 2024
2 parents cdbcd33 + 1a6cf72 commit 2901ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ImageWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 2901ab3

Please sign in to comment.