Bug 380474

Summary: changing theme corrupts graphics
Product: [Applications] kblocks Reporter: a_b_c
Component: generalAssignee: Zhongjie Cai <squall.leonhart.cai>
Status: ASSIGNED ---    
Severity: normal CC: aacid, julian.helfferich, kde-games-bugs
Priority: NOR    
Version: 0.3   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: KBlocks theme change graphics 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.