From 85bbd69caee7087f93e88ed81c7f18fa3dac48d1 Mon Sep 17 00:00:00 2001 From: LuRenJia Date: Mon, 27 Aug 2018 20:36:28 +0800 Subject: [PATCH] [MAGNIFY] Fix the magnification ratio bug for CORE-14946 (#823) This bug was caused by leaving the magnify window unrefreshed when updating the "Magnification Level" ComboBox. CORE-14946 --- base/applications/magnify/magnifier.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/applications/magnify/magnifier.c b/base/applications/magnify/magnifier.c index 057942eda20..f8d63cfce45 100644 --- a/base/applications/magnify/magnifier.c +++ b/base/applications/magnify/magnifier.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include "resource.h" @@ -923,9 +925,15 @@ INT_PTR CALLBACK OptionsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar if (HIWORD(wParam) == CBN_SELCHANGE) { HWND hCombo = GetDlgItem(hDlg,IDC_ZOOM); + LPCTSTR currentZoomValue = TEXT(""); /* Get index of current selection and the text of that selection */ - iZoom = SendMessage( hCombo, CB_GETCURSEL, (WPARAM) wParam, (LPARAM) lParam ) + 1; + int currentSelectionIndex = ComboBox_GetCurSel(hCombo); + ComboBox_GetLBText(hCombo, currentSelectionIndex, currentZoomValue); + iZoom = _ttoi(currentZoomValue); + + /* Trigger the Draw function to rezoom (which will be set false automatically after rezooming) */ + bRecreateOffscreenDC = TRUE; /* Update the magnifier UI */ Refresh();