[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:
Katayama Hirofumi MZ 2023-10-10 10:59:29 +09:00 committed by GitHub
parent 0c164f081a
commit 62eeb158a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 31 deletions

View file

@ -569,6 +569,21 @@ struct ZoomTool : ToolBase
{
}
void OnDrawOverlayOnCanvas(HDC hdc) override
{
CRect rc;
canvasWindow.GetImageRect(rc);
canvasWindow.ImageToCanvas(rc);
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(canvasWindow, &pt);
// FIXME: Draw the border of the area that is to be zoomed in
if (rc.PtInRect(pt))
DrawXorRect(hdc, &rc);
}
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override
{
if (bLeftButton)