hanabi-live
hanabi-live copied to clipboard
when in hypo, cards can have wrong orientation
steps to reproduce:
- turn on keldon mode
- start a hypothetical on the turn of someone with cards that do not have a horizontal orientation
- click and release a card
normally, this would reorient the card back to normal, but since the X/Y positions didn't change, no tween applies
i just tested and it appears that PR #2390 did not fix this bug
Did you just click and release the card?
Try clicking (hold) and move a bit. Is it working?
the bug is that when you move the card, it reorients properly, but when you don't move the card, it does not reorient
Ok, that's an old bug, pre-existing the latest changes
indeed, the bug does not have anything with your latest changes
Mouse up event doesn't fire unless there's a slight move. I think this is a Konva related bug.
darn, i guess its unfixable then for now
Acctually this breaks because of this line:
card.layout.rotation(card.layout.parent.rotation() * -1);
When we rotate the cards, they leave the mouse event area, and stop firing events from the rotation. We could just remove this line, and everything will work fine.
ok, feel free to do a PR then for that
Ok did some more research. The problem is when we have the mouse event listeners on the card, and then rotate the card.layout. If we only rotate the card, then everything works fine. Problem is that the function to check if "drag to play area" then becomes offsync with the visuall position of the card and the rectangle that is used in the function. And also the rotation back to the hand becomes off, as well as rotation when the card is played. Tried different hacks to figure something out. But didn't manage in a good way. Maybe someone else can continue.