From: Vadim Zeitlin Date: Mon, 26 Mar 2012 11:23:54 +0000 (+0000) Subject: Minor fix to wxGraphicsContext::SetInterpolationQuality() in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0d57a51305a86bff453adf302aa6ea2dedd46787 Minor fix to wxGraphicsContext::SetInterpolationQuality() in wxMSW. Only update the internal variable if we really succeeded in changing the interpolation mode. See #14134. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index af177f3365..3388f1375a 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1541,8 +1541,6 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat if (m_interpolation == interpolation) return true; - m_interpolation = interpolation; - InterpolationMode interpolationMode = InterpolationModeDefault; switch (interpolation) { @@ -1569,7 +1567,12 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat default: return false; } - m_context->SetInterpolationMode(interpolationMode); + + if ( m_context->SetInterpolationMode(interpolationMode) != Gdiplus::Ok ) + return false; + + m_interpolation = interpolation; + return true; }