mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:33:16 +00:00
[MSPAINT] Improve Zoom tool (#5781)
- Delete CCanvasWindow::drawZoomFrame. - Invalidate the canvas on mouse move when the active tool is Zoom tool. - Add ZoomTool::OnDrawOverlayOnCanvas to draw the zoom rectangle without flickering. - Improve the zoom trackbar position. - Display the zoom rate on changing the value of the zoom trackbar. - Reverse the direction of the zoom trackbar. - Don't draw the focus rectangle. CORE-19215, CORE-19216
This commit is contained in:
parent
0c164f081a
commit
62eeb158a5
5 changed files with 57 additions and 31 deletions
|
@ -29,18 +29,6 @@ CCanvasWindow::~CCanvasWindow()
|
|||
::DeleteObject(m_ahbmCached[1]);
|
||||
}
|
||||
|
||||
VOID CCanvasWindow::drawZoomFrame(INT mouseX, INT mouseY)
|
||||
{
|
||||
// FIXME: Draw the border of the area that is to be zoomed in
|
||||
CRect rc;
|
||||
GetImageRect(rc);
|
||||
ImageToCanvas(rc);
|
||||
|
||||
HDC hdc = GetDC();
|
||||
DrawXorRect(hdc, &rc);
|
||||
ReleaseDC(hdc);
|
||||
}
|
||||
|
||||
RECT CCanvasWindow::GetBaseRect()
|
||||
{
|
||||
CRect rcBase;
|
||||
|
@ -376,6 +364,9 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL
|
|||
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||
CanvasToImage(pt);
|
||||
|
||||
if (toolsModel.GetActiveTool() == TOOL_ZOOM)
|
||||
Invalidate();
|
||||
|
||||
if (m_hitSelection != HIT_NONE)
|
||||
{
|
||||
SelectionDragging(pt);
|
||||
|
@ -384,14 +375,6 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL
|
|||
|
||||
if (!m_drawing || toolsModel.GetActiveTool() <= TOOL_AIRBRUSH)
|
||||
{
|
||||
if (toolsModel.GetActiveTool() == TOOL_ZOOM)
|
||||
{
|
||||
Invalidate(FALSE);
|
||||
UpdateWindow();
|
||||
CanvasToImage(pt);
|
||||
drawZoomFrame(pt.x, pt.y);
|
||||
}
|
||||
|
||||
TRACKMOUSEEVENT tme = { sizeof(tme) };
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = m_hWnd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue