From 077c75ad65ba8172b3dd185ce5ffcd6196620a75 Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Fri, 18 Dec 2009 20:33:22 +0000 Subject: [PATCH] [paint] Andrew Faulds : Add support for deletion of rectangular selections See issue #5043 for more details. svn path=/trunk/; revision=44651 --- reactos/base/applications/paint/winproc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reactos/base/applications/paint/winproc.c b/reactos/base/applications/paint/winproc.c index 6634e6744cd..c10e7a748ec 100644 --- a/reactos/base/applications/paint/winproc.c +++ b/reactos/base/applications/paint/winproc.c @@ -711,8 +711,21 @@ WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CloseClipboard(); break; case IDM_EDITDELETESELECTION: + { + /* FIXME: deleting freeform selections unsupported */ + RECT selectionRect, areaRect; + long x1, x2, y1, y2; + + GetWindowRect(hSelection, &selectionRect); + GetWindowRect(hImageArea, &areaRect); + x1 = ((selectionRect.left - areaRect.left) / (zoom / 1000)) + 1; + y1 = ((selectionRect.top - areaRect.top) / (zoom / 1000)) + 1; + x2 = (selectionRect.right - areaRect.left) / (zoom / 1000); + y2 = (selectionRect.bottom - areaRect.top) / (zoom / 1000); + Rect(hDrawingDC, x1, y1, x2, y2, bgColor, bgColor, 0, TRUE); ShowWindow(hSelection, SW_HIDE); break; + } case IDM_EDITSELECTALL: if (activeTool == 2) {