KGamePopupItem: Use fixed offset from canvas border
Popup messages do not scale in size along with the canvas fitting into its viewport, to keep the text readable regardless of screen size. Still their distance to the canvas border (`SHOW_OFFSET`) would change when resizing the game window. This is due to the offset being specified in screen pixels, while calculations the offset is used in are expecting scene coordinates. Conversion via `mapToScene` will make the offset constant. The offset itself is also increased to a more pleasing distance (the old offset changed depending on window size, therefore it is hard to judge what the original intention was). Note that dimensions are given in device independent pixels, so the offset scales up automatically for HiDPI use cases. Test Plan: Start a new game in KBlocks and resize the window. The message when pausing the game should have the same offset from the window border as the welcome message, and the offset should be visually matching the popup's inner margin.
parent
5adee9b5
Please register or sign in to comment