]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/renderer.cpp
No changes, just remove unnecessary wxPickerBase::OnSize().
[wxWidgets.git] / src / msw / renderer.cpp
index 380ad2e383487e24a90b7b0b461f8160c24bdf68..d1b57d14feff807cbcdd59fb4aa2e2c7d3ccd97b 100644 (file)
     #define DFCS_HOT 0x1000
 #endif
 
     #define DFCS_HOT 0x1000
 #endif
 
-// When we're using GDI+, the DC might have transforms applied to it,
-// but the renderer APIs don't respect them. So we need to apply
-// the transforms to the rect ourselves.
-inline
-wxRect applyGDIPlusTransformsToRect(wxDC& dc, const wxRect& r)
-{
-    wxRect rect = r;
-#if wxUSE_GRAPHICS_CONTEXT
-    wxGCDC* gcdc = dynamic_cast<wxGCDC*>(&dc);
-    if (gcdc) 
-    {
-        double xtrans = 0;
-        double ytrans = 0;
-        wxGraphicsContext* gc = gcdc->GetGraphicsContext();
-        gc->GetTransform().TransformPoint(&xtrans, &ytrans);
-        rect.x = rect.x + (int)xtrans;
-        rect.y = rect.y + (int)ytrans;
-    }
-#endif
-    return rect;
-}
-
 // ----------------------------------------------------------------------------
 // methods common to wxRendererMSW and wxRendererXP
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // methods common to wxRendererMSW and wxRendererXP
 // ----------------------------------------------------------------------------
@@ -417,7 +395,9 @@ wxRendererMSW::DrawComboBoxDropButton(wxWindow * WXUNUSED(win),
                                       const wxRect& rect,
                                       int flags)
 {
                                       const wxRect& rect,
                                       int flags)
 {
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
     
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
     
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
@@ -439,7 +419,9 @@ wxRendererMSW::DoDrawFrameControl(UINT type,
                                   const wxRect& rect,
                                   int flags)
 {
                                   const wxRect& rect,
                                   int flags)
 {
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
@@ -642,7 +624,9 @@ wxRendererXP::DrawComboBoxDropButton(wxWindow * win,
         return;
     }
 
         return;
     }
 
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
@@ -683,7 +667,9 @@ wxRendererXP::DrawHeaderButton(wxWindow *win,
         return m_rendererNative.DrawHeaderButton(win, dc, rect, flags, sortArrow, params);
     }
 
         return m_rendererNative.DrawHeaderButton(win, dc, rect, flags, sortArrow, params);
     }
 
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_MSG( dc.GetImpl(), -1, wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
@@ -727,7 +713,9 @@ wxRendererXP::DrawTreeItemButton(wxWindow *win,
         return;
     }
 
         return;
     }
 
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
@@ -767,7 +755,9 @@ wxRendererXP::DoDrawButtonLike(HTHEME htheme,
                                const wxRect& rect,
                                int flags)
 {
                                const wxRect& rect,
                                int flags)
 {
-    wxRect adjustedRect = applyGDIPlusTransformsToRect(dc, rect);
+    wxCHECK_RET( dc.GetImpl(), wxT("Invalid wxDC") );
+
+    wxRect adjustedRect = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);
 
     RECT r;
     wxCopyRectToRECT(adjustedRect, r);