mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[USER32] Adjust the threshold in CascadeWindows (#4283)
Improve the threshold of CascadeWindows function not to make the windows too small.
This commit is contained in:
parent
463d312169
commit
2250ce80f3
1 changed files with 6 additions and 4 deletions
|
@ -2157,10 +2157,12 @@ CascadeWindows(HWND hwndParent, UINT wFlags, LPCRECT lpRect,
|
|||
if (info.chwnd != 1 && (GetWindowLongPtrW(hwnd, GWL_STYLE) & WS_THICKFRAME))
|
||||
{
|
||||
/* check the size */
|
||||
#define THRESHOLD(xy) (((xy) * 5) / 7) /* in the rate 5/7 */
|
||||
cxNew = min(cxNew, THRESHOLD(cxWork));
|
||||
cyNew = min(cyNew, THRESHOLD(cyWork));
|
||||
#undef THRESHOLD
|
||||
#define MIN_THRESHOLD(xy) (((xy) * 4) / 7) /* in the rate 4/7 */
|
||||
#define MAX_THRESHOLD(xy) (((xy) * 5) / 7) /* in the rate 5/7 */
|
||||
cxNew = max(min(cxNew, MAX_THRESHOLD(cxWork)), MIN_THRESHOLD(cxWork));
|
||||
cyNew = max(min(cyNew, MAX_THRESHOLD(cyWork)), MIN_THRESHOLD(cyWork));
|
||||
#undef MIN_THRESHOLD
|
||||
#undef MAX_THRESHOLD
|
||||
if (cx != cxNew || cy != cyNew)
|
||||
{
|
||||
/* too large. shrink if we can */
|
||||
|
|
Loading…
Reference in a new issue