comdlg32: Clamp hue and saturation when clicking in colour graph in colour dialog.
This commit is contained in:
parent
19ed584903
commit
8a0dab38c8
|
@ -337,8 +337,10 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert
|
|||
ClientToScreen(hDlg, &point);
|
||||
hwnd = GetDlgItem( hDlg, dlgitem );
|
||||
GetWindowRect(hwnd, &rect);
|
||||
if (PtInRect(&rect, point))
|
||||
{
|
||||
|
||||
if (!PtInRect(&rect, point))
|
||||
return 0;
|
||||
|
||||
GetClientRect(hwnd, &rect);
|
||||
ScreenToClient(hwnd, &point);
|
||||
|
||||
|
@ -347,14 +349,17 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert
|
|||
y = (long) (rect.bottom - point.y) * MAXVERT;
|
||||
y /= rect.bottom;
|
||||
|
||||
if (x < 0) x = 0;
|
||||
if (y < 0) y = 0;
|
||||
if (x > MAXHORI) x = MAXHORI;
|
||||
if (y > MAXVERT) y = MAXVERT;
|
||||
|
||||
if (hori)
|
||||
*hori = x;
|
||||
if (vert)
|
||||
*vert = y;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
/***********************************************************************
|
||||
* CC_MouseCheckResultWindow [internal]
|
||||
|
|
Loading…
Reference in New Issue