Skip to content

Fix initial logging errors from KGameRenderer due to too large pixmaps

Friedrich W. H. Kossebau requested to merge work/kossebau/fixbadinitsizes into master

KMinesScene in the constructor starts off with an empty scene size of 0x0. When the MineFieldItem is added then as first item, the scene is enlarged to fit the item. Due to MineFieldItem having had at that time uninitialized fields which though are used for calculating the boundingRect, this results by chance in extreme sizes like QSize(1941359222, 1217526246).

Using some dummy init values which yields small sizes solves that.

Better would be to rework when the pixmap for the background brush is actually fetched first, i.e. when we have real window/scene sizes and are shown. The current implementation is consistent though across tkdegames, so that improvement should be done in a follow-up work for all.

Would backport to 23.08 afterwards.

Merge request reports