]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor fix to wxGraphicsContext::SetInterpolationQuality() in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Mar 2012 11:23:54 +0000 (11:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Mar 2012 11:23:54 +0000 (11:23 +0000)
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

src/msw/graphics.cpp

index af177f3365ef576bb5dae0c84c103c56fa1e303f..3388f1375ad0bb565dde9bf19a1db68603e5d324 100644 (file)
@@ -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;
 }