-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix reports being shown out of screen
When connecting to a game and receiving an historian report, they would often be shown out-of-screen. This is ultimately caused by the resizing of the client window happening only after the game state is fully loaded. The placement algorithm has to provide sensible results when the widget doesn't fit inside the (small) base window size. The complicated placement algorithm relied on an initial guess for the position and could result in the widget being shown off-screen when the window was too small. Replace it with a linear scan going left-to-right and top-to-bottom across the entire screen. Also avoid recursion, permitting more attempts by lifting the limitation due to the stack size. This doesn't entirely solve the issue of widgets being shown in an unexpected location when connecting to a game: when the algorithm finds no solution, it now defaults to 0,0 to maximize visible content. This can in particular be the case for the small window size used right before connecting. I think a full revision of the pregame screens is needed, but this is way beyond the scope of this PR and won't make it to 3.1. Closes #1989.
- Loading branch information
Showing
4 changed files
with
34 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters