Bug 380474 - changing theme corrupts graphics
Summary: changing theme corrupts graphics
Status: ASSIGNED
Alias: None
Product: kblocks
Classification: Applications
Component: general (show other bugs)
Version: 0.3
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Zhongjie Cai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-02 14:16 UTC by a_b_c
Modified: 2021-03-20 17:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KBlocks theme change graphics bug (928.68 KB, video/x-matroska)
2017-06-27 18:03 UTC, a_b_c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description a_b_c 2017-06-02 14:16:19 UTC
When changing theme in middle of a game, graphics of already fallen blocks are not updated. They are updated when they change, but often get corrupted by the graphics getting shifted a notch to one side. Blocks are still there, but the graphics is in wrong place. The sidemost blocks can go over the edge.
Comment 1 Albert Astals Cid 2017-06-04 22:49:16 UTC
Works for me with version 0.4
Comment 2 a_b_c 2017-06-26 15:36:07 UTC
I upgraded to Debian 9 and KBlocks 0.4. The bug can still be replicated.
Comment 3 Albert Astals Cid 2017-06-26 22:10:07 UTC
Please attach a video of what you get (or upload it somewhere and link from here)
Comment 4 a_b_c 2017-06-27 18:03:00 UTC
Created attachment 106343 [details]
KBlocks theme change graphics bug

Sometimes lines can be cleared and the blocks are updated to the selected theme without problems. Usually blocks from different themes in case of line clear messes up the graphics. In this video graphics explode when l-bar only touches the others. Notice also that the blocks move a couple of pixels in to wrong position.
Comment 5 Albert Astals Cid 2017-06-27 19:20:30 UTC
Ok, i could reproduce it now playing a few more blocks.
Comment 6 Julian Helfferich 2021-03-20 17:47:12 UTC
I have figured out the problem. There are actually two unrelated bugs:

a) Graphics of already fallen blocks are not updated.

Root cause: Pixmap cache is not cleared when the new theme is loaded.

b) Blocks are displayed in the wrong location.

Root cause: Final location of a drop animation is not updated when the location of the game board changes with the new theme.

I will take care of fixing these two bugs and preparing corresponding merge requests.