aboutsummaryrefslogtreecommitdiff
path: root/go/ui
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-26 00:19:48 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:52 +0100
commitfe0cfc82c6cf3d3576de94e0f8b294761067af81 (patch)
tree0614d392bf60d684c1a07f261c48f632b4650393 /go/ui
parentdb469da2704f703d15e81f5e44ba157c10a21e77 (diff)
downloadmuhqs-game-fe0cfc82c6cf3d3576de94e0f8b294761067af81.tar.gz
muhqs-game-fe0cfc82c6cf3d3576de94e0f8b294761067af81.zip
intermediate commit
* use names for pile perm choice * fix PocList hover segfault * prevent mysterius autogenerated playTargets segfault
Diffstat (limited to 'go/ui')
-rw-r--r--go/ui/hoverable.go6
1 files changed, 4 insertions, 2 deletions
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