Skip to content
Verified Commit 5b7bd359 authored by snooxx 💤's avatar snooxx 💤
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment