Bug 462211 - Hiding/showing task bar in chess activities show weird animation.
Summary: Hiding/showing task bar in chess activities show weird animation.
Status: RESOLVED FIXED
Alias: None
Product: gcompris
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jazeix Johnny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-24 18:20 UTC by infiniteverma
Modified: 2022-11-24 20:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description infiniteverma 2022-11-24 18:20:44 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
In any of the chess activities, hiding the bottom taskbar results in the chess board expanding. While it expands, the chess pieces lag behind and so this animation doesn't seem clean.

STEPS TO REPRODUCE
1. Open any of the three chess activities
2. Click on bottom left button

OBSERVED RESULT
The chess board size increases while the pieces lag behind.

EXPECTED RESULT
Perhaps keeping the chess board at the same size (which happens in some other activities)?

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 animtim 2022-11-24 19:14:51 UTC
This is expected/not a bug, as this is a side effect of the way the position of the pieces is relative to the size and position of the board. And so resizing/moving the board triggers re-computation of the size and position of all the pieces, which is a bit computing-intensive and can not be  perfectly in sync with the board resizing.

This is not only happening when hiding the bar, but also for example when resizing the window, or on phone when turning between portrait/landscape.

Increasing the chess board when hiding the bar is a deliberate choice we made to improve the usability especially on small touch devices. We do the same in a few activities, but in most of them it's not really necessary.

So I'm closing it as not-a-bug, as this is expected behaviour and as far as I know we can not really do anything about it without compromising on other aspects.
Comment 2 animtim 2022-11-24 19:21:39 UTC
Oh, actually I might have spoken too fast... I've checked and this issue is mostly caused by the fact we use an Easing.InOutQuad animation of 200ms on pieces move, which is intended for when pieces move when playing. But as it's done in a way that it's triggered for any position move, it happens also when resizing...

I'm reopening the bug and I'll take a look if I can find a way to trigger this animation only when playing, not when resizing the board.
(and if I succeed I'll do the same change in checkers which is coded the same way).
Comment 3 animtim 2022-11-24 20:13:20 UTC
Git commit da9fc4224d25a47d03355109258df03ded5c2438 by Timothée Giet.
Committed on 24/11/2022 at 20:11.
Pushed by timotheegiet into branch 'master'.

chess, fix animation of pieces while resizing the board

do not animate piece position change while resizing the board

M  +3    -0    src/activities/chess/Chess.qml
M  +2    -2    src/activities/chess/Piece.qml
M  +2    -0    src/activities/chess/chess.js

https://invent.kde.org/education/gcompris/commit/da9fc4224d25a47d03355109258df03ded5c2438
Comment 4 animtim 2022-11-24 20:33:31 UTC
Problem fixed, thanks for the report :)