mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[COMDLG32] Color Picker: Fix black cross (#6242)
JIRA issue: CORE-19403, CORE-19405 - Fix HRGN handle leak. - Fix black cross coordinates.
This commit is contained in:
parent
8e01ab830b
commit
d8108a64a4
1 changed files with 15 additions and 1 deletions
|
@ -523,10 +523,15 @@ static void CC_PaintCross(CCPRIV *infoPtr)
|
||||||
if (IsWindowVisible(hwnd)) /* if full size */
|
if (IsWindowVisible(hwnd)) /* if full size */
|
||||||
{
|
{
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
int w = 8, wc = 6;
|
||||||
|
#else
|
||||||
int w = GetDialogBaseUnits() - 1;
|
int w = GetDialogBaseUnits() - 1;
|
||||||
int wc = GetDialogBaseUnits() * 3 / 4;
|
int wc = GetDialogBaseUnits() * 3 / 4;
|
||||||
|
#endif
|
||||||
RECT rect;
|
RECT rect;
|
||||||
POINT point, p;
|
POINT point, p;
|
||||||
|
HRGN region;
|
||||||
HPEN hPen;
|
HPEN hPen;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
@ -535,7 +540,9 @@ static void CC_PaintCross(CCPRIV *infoPtr)
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
hDC = GetDC(hwnd);
|
hDC = GetDC(hwnd);
|
||||||
SelectClipRgn( hDC, CreateRectRgnIndirect(&rect));
|
region = CreateRectRgnIndirect(&rect);
|
||||||
|
SelectClipRgn(hDC, region);
|
||||||
|
DeleteObject(region);
|
||||||
|
|
||||||
point.x = ((long)rect.right * (long)x) / (long)MAXHORI;
|
point.x = ((long)rect.right * (long)x) / (long)MAXHORI;
|
||||||
point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT;
|
point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT;
|
||||||
|
@ -544,10 +551,17 @@ static void CC_PaintCross(CCPRIV *infoPtr)
|
||||||
infoPtr->oldcross.right - infoPtr->oldcross.left,
|
infoPtr->oldcross.right - infoPtr->oldcross.left,
|
||||||
infoPtr->oldcross.bottom - infoPtr->oldcross.top,
|
infoPtr->oldcross.bottom - infoPtr->oldcross.top,
|
||||||
infoPtr->hdcMem, infoPtr->oldcross.left, infoPtr->oldcross.top, SRCCOPY);
|
infoPtr->hdcMem, infoPtr->oldcross.left, infoPtr->oldcross.top, SRCCOPY);
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
infoPtr->oldcross.left = point.x - w - 3;
|
||||||
|
infoPtr->oldcross.right = point.x + w + 3;
|
||||||
|
infoPtr->oldcross.top = point.y - w - 3;
|
||||||
|
infoPtr->oldcross.bottom = point.y + w + 3;
|
||||||
|
#else
|
||||||
infoPtr->oldcross.left = point.x - w - 1;
|
infoPtr->oldcross.left = point.x - w - 1;
|
||||||
infoPtr->oldcross.right = point.x + w + 1;
|
infoPtr->oldcross.right = point.x + w + 1;
|
||||||
infoPtr->oldcross.top = point.y - w - 1;
|
infoPtr->oldcross.top = point.y - w - 1;
|
||||||
infoPtr->oldcross.bottom = point.y + w + 1;
|
infoPtr->oldcross.bottom = point.y + w + 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
hPen = CreatePen(PS_SOLID, 3, RGB(0, 0, 0)); /* -black- color */
|
hPen = CreatePen(PS_SOLID, 3, RGB(0, 0, 0)); /* -black- color */
|
||||||
hPen = SelectObject(hDC, hPen);
|
hPen = SelectObject(hDC, hPen);
|
||||||
|
|
Loading…
Reference in a new issue