From fe0cfc82c6cf3d3576de94e0f8b294761067af81 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 26 Feb 2023 00:19:48 +0100 Subject: intermediate commit * use names for pile perm choice * fix PocList hover segfault * prevent mysterius autogenerated playTargets segfault --- go/ui/hoverable.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'go/ui') diff --git a/go/ui/hoverable.go b/go/ui/hoverable.go index 54d4ec15..30415c8d 100644 --- a/go/ui/hoverable.go +++ b/go/ui/hoverable.go @@ -62,11 +62,13 @@ type hoverCardView struct { func (h *hoverCardView) init(w Widget) { h.createHint = func(x, y int) Widget { - card := w.FindObjectAt(x, y).(*game.Card) - if card == nil { + obj := w.FindObjectAt(x, y) + if obj == nil { return nil } + card := obj.(*game.Card) + wx, wy := x, y if x+HOVER_CARD_WIDTH > h.xMax || y+HOVER_CARD_HEIGHT > h.yMax { wx = x - HOVER_CARD_WIDTH -- cgit v1.2.3