[commit] r1201 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Mar 8 14:03:54 CST 2011


Author: ksmyth
Date: Tue Mar  8 14:03:53 2011
New Revision: 1201

Log:
Fix GME-339: scrolling with an old decorator was broken

Modified:
   trunk/GME/Gme/GMEView.cpp

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Wed Mar  2 10:42:23 2011	(r1200)
+++ trunk/GME/Gme/GMEView.cpp	Tue Mar  8 14:03:53 2011	(r1201)
@@ -5,6 +5,7 @@
 #include "GMEApp.h"
 #include <math.h>
 #include <algorithm>
+#include <new>
 #include "GMEstd.h"
 
 #include "GuiMeta.h"
@@ -67,12 +68,6 @@
 #endif
 
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CViewDriver
 bool CViewDriver::attrNeedsRefresh = false;
@@ -834,11 +829,16 @@
 		pos = children.GetHeadPosition();
 		while (pos) {
 			CGuiFco* fco = children.GetNext(pos);
-			ASSERT(fco != NULL);
+                  ASSERT(fco != NULL);
 			if (fco->IsVisible()) {
 				CGuiConnection* conn = fco->dynamic_cast_CGuiConnection();
-				if (!conn)
+				if (!conn) {
+					// GME-339: Gdiplus::Graphics may modify pDC (e.g. SetViewportOrgEx) when a new-style decorator runs
+					// a modified pDC makes old-style (i.e. no DrawEx) decorators render incorrectly (e.g. when the scrollbar is scrolled)
+					gdip.~Graphics();
+					::new ((void*)&gdip) Gdiplus::Graphics(pDC->m_hDC);
 					fco->Draw(pDC->m_hDC, &gdip);
+				}
 			}
 		}
 		DrawConnections(pDC->m_hDC, &gdip);


More information about the gme-commit mailing list