Bug 380464

Summary: screen is not scaled if started after resizing
Product: [Applications] kblocks Reporter: a_b_c
Component: generalAssignee: Zhongjie Cai <squall.leonhart.cai>
Status: RESOLVED FIXED    
Severity: normal CC: julian.helfferich, kde-games-bugs, schwarzer, simonandric5
Priority: NOR    
Version: 0.3   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description a_b_c 2017-06-02 11:33:55 UTC
I start the program, resize window and then start a new game. Game area is still small, but scales up when window is resized slightly. Sometimes game scales up after (resizing and) starting, but not to the full amount. If window is maximized before starting a new game, it scales up properly.
Comment 1 a_b_c 2017-06-26 15:34:38 UTC
I upgraded to Debian 9 and KBlock 0.4. The bug still occurs.
Comment 2 Frederik Schwarzer 2017-06-26 17:48:51 UTC
I can confirm this with the 0.4 from Ubuntu.
Comment 3 Julian Helfferich 2017-06-27 19:21:06 UTC
I can confirm this with the current master branch.
Comment 4 Julian Helfferich 2017-06-27 20:37:42 UTC
I have suggested a fix on reviewboard:

https://git.reviewboard.kde.org/r/130167/
Comment 5 Albert Astals Cid 2017-07-27 13:04:47 UTC
Git commit 6ee616019ea9e67eb19ed0a8ce53feca4e7633a0 by Albert Astals Cid, on behalf of Julian Helfferich.
Committed on 27/07/2017 at 13:04.
Pushed by aacid into branch 'Applications/17.08'.

Fix incorrect resize before game is started

When the game window is resized before a game is started, the game scene is not correctly rescaled. When starting the game it might be too small (it seems never to be too large).

This commit fixes the bug by triggering a fitInView() call of the gameView. The same function is triggered by a resize event.
REVIEW: 130167

M  +2    -0    KBlocksWin.cpp

https://commits.kde.org/kblocks/6ee616019ea9e67eb19ed0a8ce53feca4e7633a0