hanabi-live icon indicating copy to clipboard operation
hanabi-live copied to clipboard

when in hypo, cards can have wrong orientation

Open Zamiell opened this issue 2 years ago • 10 comments

steps to reproduce:

  1. turn on keldon mode
  2. start a hypothetical on the turn of someone with cards that do not have a horizontal orientation
  3. 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

Zamiell avatar Dec 24 '21 00:12 Zamiell

i just tested and it appears that PR #2390 did not fix this bug

Zamiell avatar Dec 24 '21 01:12 Zamiell

Did you just click and release the card?

Try clicking (hold) and move a bit. Is it working?

DrAnax avatar Dec 24 '21 03:12 DrAnax

the bug is that when you move the card, it reorients properly, but when you don't move the card, it does not reorient

Zamiell avatar Dec 24 '21 03:12 Zamiell

Ok, that's an old bug, pre-existing the latest changes

DrAnax avatar Dec 24 '21 03:12 DrAnax

indeed, the bug does not have anything with your latest changes

Zamiell avatar Dec 24 '21 03:12 Zamiell

Mouse up event doesn't fire unless there's a slight move. I think this is a Konva related bug.

DrAnax avatar Dec 24 '21 03:12 DrAnax

darn, i guess its unfixable then for now

Zamiell avatar Dec 24 '21 03:12 Zamiell

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.

Krycke avatar Nov 30 '22 09:11 Krycke

ok, feel free to do a PR then for that

Zamiell avatar Nov 30 '22 09:11 Zamiell

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.

Krycke avatar Nov 30 '22 11:11 Krycke