Author: bfreisen
Date: Wed Feb 5 18:58:45 2014
New Revision: 61996
URL:
http://svn.reactos.org/svn/reactos?rev=61996&view=rev
Log:
[MSPAINT] Fix CORE-5954, CORE-6798 and a sign typo regarding the upper right selection
resizer
Modified:
trunk/reactos/base/applications/mspaint/selection.c
trunk/reactos/base/applications/mspaint/toolsettings.c
trunk/reactos/base/applications/mspaint/winproc.c
Modified: trunk/reactos/base/applications/mspaint/selection.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/selection.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/selection.c [iso-8859-1] Wed Feb 5 18:58:45
2014
@@ -119,8 +119,9 @@
rectSel_dest[3] -= yDelta;
break;
case 3:
+ rectSel_dest[1] += yDelta;
rectSel_dest[2] += xDelta;
- rectSel_dest[1] += yDelta;
+ rectSel_dest[3] -= yDelta;
break;
case 4:
rectSel_dest[0] += xDelta;
Modified: trunk/reactos/base/applications/mspaint/toolsettings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/toolsettings.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/toolsettings.c [iso-8859-1] Wed Feb 5
18:58:45 2014
@@ -183,6 +183,11 @@
{
transpBg = (y - 2) / 31;
InvalidateRect(hwnd, NULL, TRUE);
+
+ /* force refresh of selection contents */
+ SendMessage(hSelection, WM_LBUTTONDOWN, 0, MAKELPARAM(0, 0));
+ SendMessage(hSelection, WM_MOUSEMOVE, 0, MAKELPARAM(0, 0));
+ SendMessage(hSelection, WM_LBUTTONUP, 0, MAKELPARAM(0, 0));
}
break;
case TOOL_RUBBER:
Modified: trunk/reactos/base/applications/mspaint/winproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] Wed Feb 5 18:58:45
2014
@@ -179,6 +179,9 @@
void
InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
{
+ HDC hTempDC;
+ HBITMAP hTempMask;
+
HWND hToolbar = FindWindowEx(hToolBoxContainer, NULL, TOOLBARCLASSNAME, NULL);
SendMessage(hToolbar, TB_CHECKBUTTON, ID_RECTSEL, MAKELONG(TRUE, 0));
SendMessage(window, WM_COMMAND, ID_RECTSEL, 0);
@@ -191,10 +194,21 @@
rectSel_dest[0] = rectSel_dest[1] = 0;
rectSel_dest[2] = GetDIBWidth(hSelBm);
rectSel_dest[3] = GetDIBHeight(hSelBm);
- BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2],
rectSel_dest[3],
- hSelDC, 0, 0, SRCCOPY);
+
+ hTempDC = CreateCompatibleDC(hSelDC);
+ hTempMask = CreateBitmap(rectSel_dest[2], rectSel_dest[3], 1, 1, NULL);
+ SelectObject(hTempDC, hTempMask);
+ Rect(hTempDC, 0, 0, rectSel_dest[2], rectSel_dest[3], 0x00ffffff, 0x00ffffff, 1, 1);
+ DeleteObject(hSelMask);
+ hSelMask = hTempMask;
+ DeleteDC(hTempDC);
+
placeSelWin();
ShowWindow(hSelection, SW_SHOW);
+ /* force refresh of selection contents */
+ SendMessage(hSelection, WM_LBUTTONDOWN, 0, MAKELPARAM(0, 0));
+ SendMessage(hSelection, WM_MOUSEMOVE, 0, MAKELPARAM(0, 0));
+ SendMessage(hSelection, WM_LBUTTONUP, 0, MAKELPARAM(0, 0));
}
BOOL drawing;
@@ -973,10 +987,10 @@
SelectObject(hSelDC, hSelBm);
StretchBlt(hSelDC, rectSel_dest[2] - 1, 0,
-rectSel_dest[2], rectSel_dest[3], hSelDC,
0, 0, rectSel_dest[2], rectSel_dest[3],
SRCCOPY);
- /* force refresh of selection contents, used also in case
2 and case 4 */
- SendMessage(hSelection, WM_LBUTTONDOWN, 0, 0);
- SendMessage(hSelection, WM_MOUSEMOVE, 0, 0);
- SendMessage(hSelection, WM_LBUTTONUP, 0, 0);
+ /* force refresh of selection contents */
+ SendMessage(hSelection, WM_LBUTTONDOWN, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_MOUSEMOVE, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_LBUTTONUP, 0, MAKELPARAM(0,
0));
}
else
{
@@ -995,9 +1009,10 @@
SelectObject(hSelDC, hSelBm);
StretchBlt(hSelDC, 0, rectSel_dest[3] - 1,
rectSel_dest[2], -rectSel_dest[3], hSelDC,
0, 0, rectSel_dest[2], rectSel_dest[3],
SRCCOPY);
- SendMessage(hSelection, WM_LBUTTONDOWN, 0, 0);
- SendMessage(hSelection, WM_MOUSEMOVE, 0, 0);
- SendMessage(hSelection, WM_LBUTTONUP, 0, 0);
+ /* force refresh of selection contents */
+ SendMessage(hSelection, WM_LBUTTONDOWN, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_MOUSEMOVE, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_LBUTTONUP, 0, MAKELPARAM(0,
0));
}
else
{
@@ -1018,9 +1033,10 @@
SelectObject(hSelDC, hSelBm);
StretchBlt(hSelDC, rectSel_dest[2] - 1, rectSel_dest[3] -
1, -rectSel_dest[2], -rectSel_dest[3], hSelDC,
0, 0, rectSel_dest[2], rectSel_dest[3],
SRCCOPY);
- SendMessage(hSelection, WM_LBUTTONDOWN, 0, 0);
- SendMessage(hSelection, WM_MOUSEMOVE, 0, 0);
- SendMessage(hSelection, WM_LBUTTONUP, 0, 0);
+ /* force refresh of selection contents */
+ SendMessage(hSelection, WM_LBUTTONDOWN, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_MOUSEMOVE, 0, MAKELPARAM(0,
0));
+ SendMessage(hSelection, WM_LBUTTONUP, 0, MAKELPARAM(0,
0));
}
else
{