mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:05:42 +00:00
[MSPAINT] Fix crash on zoom out
- Check the denominator for zero for both zoomed width and height. - Do not allow to move zoom slider above possible position. - Move commonly used `zoomTo` function into new header file. CORE-14539
This commit is contained in:
parent
065e70048d
commit
955048e50a
5 changed files with 31 additions and 9 deletions
|
@ -4,6 +4,7 @@
|
|||
* FILE: base/applications/mspaint/toolsettings.cpp
|
||||
* PURPOSE: Window procedure of the tool settings window
|
||||
* PROGRAMMERS: Benedikt Freisen
|
||||
* Stanislav Motylkov
|
||||
*/
|
||||
|
||||
/* INCLUDES *********************************************************/
|
||||
|
@ -12,8 +13,6 @@
|
|||
|
||||
/* FUNCTIONS ********************************************************/
|
||||
|
||||
extern void zoomTo(int, int, int);
|
||||
|
||||
LRESULT CToolSettingsWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, WINBOOL& bHandled)
|
||||
{
|
||||
RECT trackbarZoomPos = {1, 1, 1 + 40, 1 + 64};
|
||||
|
@ -25,7 +24,10 @@ LRESULT CToolSettingsWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, W
|
|||
|
||||
LRESULT CToolSettingsWindow::OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
zoomTo(125 << trackbarZoom.SendMessage(TBM_GETPOS, 0, 0), 0, 0);
|
||||
if (!zoomTo(125 << trackbarZoom.SendMessage(TBM_GETPOS, 0, 0), 0, 0))
|
||||
{
|
||||
OnToolsModelZoomChanged(nMsg, wParam, lParam, bHandled);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue