]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
Fixed a problem with borders being set wrong sometimes on wxMSW, XP, VC++ 7
[wxWidgets.git] / src / msw / dc.cpp
index 293626093c0528412fde19c0414c3075596f5c47..3bb029de5e7f99536db32d943d4d36ec379b234c 100644 (file)
     #include <print.h>
 #endif
 
+/* Quaternary raster codes */
+#ifndef MAKEROP4
+#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
+#endif
+
 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
 
 // ---------------------------------------------------------------------------
@@ -1129,13 +1134,13 @@ void wxDC::DoDrawRotatedText(const wxString& text,
 
         // "upper left" and "upper right"
         CalcBoundingBox(x, y);
-        CalcBoundingBox(x + w*cos(rad), y - h*sin(rad));
+        CalcBoundingBox(x + wxCoord(w*cos(rad)), y - wxCoord(h*sin(rad)));
 
         // "bottom left" and "bottom right"
         x += (wxCoord)(h*sin(rad));
         y += (wxCoord)(h*cos(rad));
         CalcBoundingBox(x, y);
-        CalcBoundingBox(x + h*sin(rad), y + h*cos(rad));
+        CalcBoundingBox(x + wxCoord(h*sin(rad)), y + wxCoord(h*cos(rad)));
     }
 #endif
 }
@@ -2108,12 +2113,12 @@ void wxDC::AddToDCCache(wxDCCacheEntry* entry)
 
 void wxDC::ClearCache()
 {
-    sm_bitmapCache.DeleteContents(TRUE);
-    sm_bitmapCache.Clear();
-    sm_bitmapCache.DeleteContents(FALSE);
     sm_dcCache.DeleteContents(TRUE);
     sm_dcCache.Clear();
     sm_dcCache.DeleteContents(FALSE);
+    sm_bitmapCache.DeleteContents(TRUE);
+    sm_bitmapCache.Clear();
+    sm_bitmapCache.DeleteContents(FALSE);
 }
 
 // Clean up cache at app exit