-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skipping of move animation #22
Comments
Yeah I have definitely seen this before and I did once have a quick look but didn't find anything. I'm up to have another look though. If you have any more ideas about the cause then definitely let me know. |
By the way, I have been skim reading all the other stuff you and others have come up with in discussions, I've just been really busy with work and haven't quite had the time to get to it properly yet. It is much appreciated though and if you hit something that is really really blocking you, definitely ping me as much as you want and I'll reprioritise. |
Thanks Alex, much appreciated, and do not worry, I was able to figure out most on my own. Apart from this topic here, I do not have any open issues or questions. I left some code for arrows in the discussions, this is more for you to consider, whether you want to include some functionality like this directly in the package. I am sure, you would want to rewrite the code a bit though ;) |
Looking into the issue, I hope I can at least give a first indication, why the skipping is happening: In my case, the issue seems to be with the variable animate in board_pieces.dart. In board_pieces.dart, there is a if-clause to check, whether the element should be animated at that moment. During piece movement, it is called repeatedly:
In cases, when the animation is skipped, the check always evaluates to false, because animate is always false.
However, when there is no skipping observable, the animate variable is true, which allows for the entire clause to evaluate to true once:
The animate variable is determined as follows:
When you comment out the animate = oldWidget[...] line, there is no skipping of the animation (but the animation is also generated in cases when the user moves a piece by hand, which is not supposed to be happening). I do not fully understand mechanic of the animate variable, but maybe this helps already. In my case from fen starting position, the skipping occurs realiably when moving pawns 2 steps forwards. Also, when queen moves sideways, but not if queen moves diagonally. In the same position it is replicable, but I cannot see a clear pattern that explains it. |
Hi Alex,
I am experiencing a display issue with the squares chessboard when programmatically making a move. I use the makeMove command on the corresponding bishop instance and update the SquaresState. Sometimes, the move animation is skipped. As you can see in the video, this seems to be randomly on specific moves, however it then repeats when I use the undo command and repeat the specific move:
WhatsApp.Video.2024-01-30.at.10.49.02_62514847.mp4
Here, it is for instance the knight move to B6, where the animation is simply skipped. I have increased the animation duration to make it more visible. As there is no difference between how I execute the different moves, I am a bit confused why this is happening sometimes.
Do you have any idea what could be the reason here? Have you faced something similar in the past?
Thanks in advance for any advise!
The text was updated successfully, but these errors were encountered: