Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56107 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
From: Nikolay Sivov nsivov@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56107 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comdlg32/colordlg.c | 65 ++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 29 deletions(-)
diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index 0093b455b1b..6bb993e7454 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -79,7 +79,6 @@ typedef struct CCPRIVATE RECT fullsize; /* original dialog window size */ UINT msetrgb; /* # of SETRGBSTRING message (today not used) */ RECT old3angle; /* last position of l-marker */ - RECT oldcross; /* last position of color/saturation marker */ BOOL updating; /* to prevent recursive WM_COMMAND/EN_UPDATE processing */ int h; int s; @@ -518,47 +517,52 @@ static void CC_PaintCross(CCPRIV *infoPtr)
if (IsWindowVisible(hwnd)) /* if full size */ { + int w, wc, width; HDC hDC; - int w = GetDialogBaseUnits() - 1; - int wc = GetDialogBaseUnits() * 3 / 4; RECT rect; - POINT point, p; + POINT point; HRGN region; - HPEN hPen; - int x, y;
x = infoPtr->h; y = infoPtr->s;
+ rect.left = 6; + rect.right = 2; + rect.top = 1; + rect.bottom = 0; + MapDialogRect(infoPtr->hwndSelf, &rect); + w = rect.left; + wc = rect.right; + width = rect.top; + GetClientRect(hwnd, &rect); hDC = GetDC(hwnd); region = CreateRectRgnIndirect(&rect); SelectClipRgn(hDC, region); DeleteObject(region);
- point.x = (rect.right * x) / MAXHORI; - point.y = rect.bottom - (rect.bottom * y) / MAXVERT; - if ( infoPtr->oldcross.left != infoPtr->oldcross.right ) - BitBlt(hDC, infoPtr->oldcross.left, infoPtr->oldcross.top, - infoPtr->oldcross.right - infoPtr->oldcross.left, - infoPtr->oldcross.bottom - infoPtr->oldcross.top, - infoPtr->hdcMem, infoPtr->oldcross.left, infoPtr->oldcross.top, SRCCOPY); - infoPtr->oldcross.left = point.x - w - 1; - infoPtr->oldcross.right = point.x + w + 1; - infoPtr->oldcross.top = point.y - w - 1; - infoPtr->oldcross.bottom = point.y + w + 1; - - hPen = CreatePen(PS_SOLID, 3, RGB(0, 0, 0)); /* -black- color */ - hPen = SelectObject(hDC, hPen); - MoveToEx(hDC, point.x - w, point.y, &p); - LineTo(hDC, point.x - wc, point.y); - MoveToEx(hDC, point.x + wc, point.y, &p); - LineTo(hDC, point.x + w, point.y); - MoveToEx(hDC, point.x, point.y - w, &p); - LineTo(hDC, point.x, point.y - wc); - MoveToEx(hDC, point.x, point.y + wc, &p); - LineTo(hDC, point.x, point.y + w); - DeleteObject( SelectObject(hDC, hPen)); + point.x = (rect.right * infoPtr->h) / MAXHORI; + point.y = rect.bottom - (rect.bottom * infoPtr->s) / MAXVERT; + + rect.left = point.x - w; + rect.right = point.x - wc; + rect.top = point.y - width; + rect.bottom = point.y + width; + FillRect(hDC, &rect, GetStockObject(BLACK_BRUSH)); + + rect.left = point.x + wc; + rect.right = point.x + w; + FillRect(hDC, &rect, GetStockObject(BLACK_BRUSH)); + + rect.left = point.x - width; + rect.right = point.x + width; + rect.top = point.y - w; + rect.bottom = point.y - wc; + FillRect(hDC, &rect, GetStockObject(BLACK_BRUSH)); + + rect.top = point.y + wc; + rect.bottom = point.y + w; + FillRect(hDC, &rect, GetStockObject(BLACK_BRUSH));
ReleaseDC(hwnd, hDC); } @@ -1101,6 +1105,7 @@ static LRESULT CC_WMLButtonUp( CCPRIV *infoPtr ) { infoPtr->capturedGraph = 0; ReleaseCapture(); + CC_PaintColorGraph(infoPtr); CC_PaintCross(infoPtr); return 1; } @@ -1125,6 +1130,7 @@ static LRESULT CC_WMMouseMove( CCPRIV *infoPtr, LPARAM lParam ) infoPtr->lpcc->rgbResult = CC_HSLtoRGB(infoPtr->h, infoPtr->s, infoPtr->l); CC_EditSetRGB(infoPtr); CC_EditSetHSL(infoPtr); + CC_PaintColorGraph(infoPtr); CC_PaintCross(infoPtr); CC_PaintTriangle(infoPtr); CC_PaintSelectedColor(infoPtr); @@ -1178,6 +1184,7 @@ static LRESULT CC_WMLButtonDown( CCPRIV *infoPtr, LPARAM lParam ) { CC_EditSetRGB(infoPtr); CC_EditSetHSL(infoPtr); + CC_PaintColorGraph(infoPtr); CC_PaintCross(infoPtr); CC_PaintTriangle(infoPtr); CC_PaintSelectedColor(infoPtr);