https://git.reactos.org/?p=reactos.git;a=commitdiff;h=edf92c004d5d7e6994596…
commit edf92c004d5d7e69945961266c156aa6445a6d8a
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 10 21:41:00 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 10 21:41:00 2022 +0900
[MSPAINT] Don't hide selection on zooming (#4266)
- Don't hide the selection window on zooming.
- Move the selection window by calling placeSelWin() when zoomed.
CORE-17969
---
base/applications/mspaint/selection.cpp | 6 ++++++
base/applications/mspaint/selection.h | 2 ++
base/applications/mspaint/toolsmodel.cpp | 2 ++
base/applications/mspaint/winproc.cpp | 1 -
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/base/applications/mspaint/selection.cpp
b/base/applications/mspaint/selection.cpp
index 8edd85ba173..90bcbde70bb 100644
--- a/base/applications/mspaint/selection.cpp
+++ b/base/applications/mspaint/selection.cpp
@@ -285,3 +285,9 @@ LRESULT CSelectionWindow::OnMouseWheel(UINT nMsg, WPARAM wParam,
LPARAM lParam,
{
return ::SendMessage(GetParent(), nMsg, wParam, lParam);
}
+
+LRESULT CSelectionWindow::OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM
lParam, BOOL& bHandled)
+{
+ placeSelWin();
+ return 0;
+}
diff --git a/base/applications/mspaint/selection.h
b/base/applications/mspaint/selection.h
index 44c9bac0ade..4dcd5541bdb 100644
--- a/base/applications/mspaint/selection.h
+++ b/base/applications/mspaint/selection.h
@@ -26,6 +26,7 @@ public:
MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged)
MESSAGE_HANDLER(WM_TOOLSMODELSETTINGSCHANGED, OnToolsModelSettingsChanged)
+ MESSAGE_HANDLER(WM_TOOLSMODELZOOMCHANGED, OnToolsModelZoomChanged)
MESSAGE_HANDLER(WM_SELECTIONMODELREFRESHNEEDED, OnSelectionModelRefreshNeeded)
MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
@@ -42,6 +43,7 @@ public:
LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled);
+ LRESULT OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
LRESULT OnSelectionModelRefreshNeeded(UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled);
LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
diff --git a/base/applications/mspaint/toolsmodel.cpp
b/base/applications/mspaint/toolsmodel.cpp
index f5725207a1c..021df46d336 100644
--- a/base/applications/mspaint/toolsmodel.cpp
+++ b/base/applications/mspaint/toolsmodel.cpp
@@ -181,6 +181,8 @@ void ToolsModel::NotifyZoomChanged()
toolSettingsWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED);
if (textEditWindow.IsWindow())
textEditWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED);
+ if (selectionWindow.IsWindow())
+ selectionWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED);
}
void ToolsModel::OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
diff --git a/base/applications/mspaint/winproc.cpp
b/base/applications/mspaint/winproc.cpp
index 43b0f812c1f..a0af103f080 100644
--- a/base/applications/mspaint/winproc.cpp
+++ b/base/applications/mspaint/winproc.cpp
@@ -36,7 +36,6 @@ zoomTo(int newZoom, int mouseX, int mouseY)
toolsModel.SetZoom(newZoom);
- selectionWindow.ShowWindow(SW_HIDE);
imageArea.MoveWindow(GRIP_SIZE, GRIP_SIZE, Zoomed(imageModel.GetWidth()),
Zoomed(imageModel.GetHeight()), FALSE);
scrollboxWindow.Invalidate(TRUE);
imageArea.Invalidate(FALSE);