diff --git a/base/applications/mspaint/history.cpp b/base/applications/mspaint/history.cpp index 46a7341ff1c..91cc1736614 100644 --- a/base/applications/mspaint/history.cpp +++ b/base/applications/mspaint/history.cpp @@ -254,7 +254,7 @@ void ImageModel::RotateNTimes90Degrees(int iN) NotifyImageChanged(); } -void ImageModel::Bound(POINT& pt) const +void ImageModel::Clamp(POINT& pt) const { pt.x = max(0, min(pt.x, GetWidth())); pt.y = max(0, min(pt.y, GetHeight())); diff --git a/base/applications/mspaint/history.h b/base/applications/mspaint/history.h index 2b74f306248..321680236c7 100644 --- a/base/applications/mspaint/history.h +++ b/base/applications/mspaint/history.h @@ -36,7 +36,7 @@ public: void FlipHorizontally(); void FlipVertically(); void RotateNTimes90Degrees(int iN); - void Bound(POINT& pt) const; + void Clamp(POINT& pt) const; void NotifyImageChanged(); protected: diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index dad03d9fc0a..0bb4607ad05 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -159,7 +159,7 @@ struct FreeSelTool : ToolBase if (bLeftButton) { POINT pt = { x, y }; - imageModel.Bound(pt); + imageModel.Clamp(pt); selectionModel.PushToPtStack(pt); imageModel.NotifyImageChanged(); } @@ -247,7 +247,7 @@ struct RectSelTool : ToolBase if (bLeftButton) { POINT pt = { x, y }; - imageModel.Bound(pt); + imageModel.Clamp(pt); selectionModel.SetRectFromPoints(g_ptStart, pt); imageModel.NotifyImageChanged(); } @@ -258,7 +258,7 @@ struct RectSelTool : ToolBase POINT pt = { x, y }; if (bLeftButton) { - imageModel.Bound(pt); + imageModel.Clamp(pt); selectionModel.SetRectFromPoints(g_ptStart, pt); selectionModel.m_bShow = !selectionModel.m_rc.IsRectEmpty(); imageModel.NotifyImageChanged(); @@ -528,7 +528,7 @@ struct TextTool : ToolBase void UpdatePoint(LONG x, LONG y) { POINT pt = { x, y }; - imageModel.Bound(pt); + imageModel.Clamp(pt); selectionModel.SetRectFromPoints(g_ptStart, pt); imageModel.NotifyImageChanged(); } @@ -572,7 +572,7 @@ struct TextTool : ToolBase void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { POINT pt = { x, y }; - imageModel.Bound(pt); + imageModel.Clamp(pt); selectionModel.SetRectFromPoints(g_ptStart, pt); BOOL bTextBoxShown = ::IsWindowVisible(textEditWindow);