Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 132 of file mouse.c.
Referenced by WindowProcedure().
{ switch (activeTool) { case TOOL_FREESEL: if (ptSP == 0) newReversible(); ptSP++; if (ptSP % 1024 == 0) ptStack = HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, ptStack, sizeof(POINT) * (ptSP + 1024)); ptStack[ptSP].x = max(0, min(x, imgXRes)); ptStack[ptSP].y = max(0, min(y, imgYRes)); resetToU1(); Poly(hdc, ptStack, ptSP + 1, 0, 0, 2, 0, FALSE); break; case TOOL_RECTSEL: { int tempX; int tempY; resetToU1(); tempX = max(0, min(x, imgXRes)); tempY = max(0, min(y, imgYRes)); rectSel_dest[0] = rectSel_src[0] = min(startX, tempX); rectSel_dest[1] = rectSel_src[1] = min(startY, tempY); rectSel_dest[2] = rectSel_src[2] = max(startX, tempX) - min(startX, tempX); rectSel_dest[3] = rectSel_src[3] = max(startY, tempY) - min(startY, tempY); RectSel(hdc, startX, startY, tempX, tempY); break; } case TOOL_RUBBER: Erase(hdc, lastX, lastY, x, y, bg, rubberRadius); break; case TOOL_PEN: Line(hdc, lastX, lastY, x, y, fg, 1); break; case TOOL_BRUSH: Brush(hdc, lastX, lastY, x, y, fg, brushStyle); break; case TOOL_AIRBRUSH: Airbrush(hdc, x, y, fg, airBrushWidth); break; case TOOL_LINE: resetToU1(); if (GetAsyncKeyState(VK_SHIFT) < 0) roundTo8Directions(startX, startY, &x, &y); Line(hdc, startX, startY, x, y, fg, lineWidth); break; case TOOL_BEZIER: resetToU1(); pointStack[pointSP].x = x; pointStack[pointSP].y = y; switch (pointSP) { case 1: Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, fg, lineWidth); break; case 2: Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], fg, lineWidth); break; case 3: Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], fg, lineWidth); break; } break; case TOOL_RECT: resetToU1(); if (GetAsyncKeyState(VK_SHIFT) < 0) regularize(startX, startY, &x, &y); Rect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle); break; case TOOL_SHAPE: resetToU1(); pointStack[pointSP].x = x; pointStack[pointSP].y = y; if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, &pointStack[pointSP].x, &pointStack[pointSP].y); if (pointSP + 1 >= 2) Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE); break; case TOOL_ELLIPSE: resetToU1(); if (GetAsyncKeyState(VK_SHIFT) < 0) regularize(startX, startY, &x, &y); Ellp(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle); break; case TOOL_RRECT: resetToU1(); if (GetAsyncKeyState(VK_SHIFT) < 0) regularize(startX, startY, &x, &y); RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle); break; } lastX = x; lastY = y; }