]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dcbuffer.h
added wxColour(RGBColor) ctor and use it insteaf of constructing wxColour from RGBCol...
[wxWidgets.git] / include / wx / dcbuffer.h
index ef5383bbdf2baa23f1c2d4d55756023946bfb832..0f4e896d9fe8aa4c3609ed11dabc7eb6e0afcfc3 100644 (file)
@@ -173,7 +173,7 @@ public:
         if( buffer.IsOk() )
             Init(&m_paintdc, buffer, style);
         else
-            Init(&m_paintdc, window->GetClientSize(), style);
+            Init(&m_paintdc, GetBufferedSize(window, style), style);
     }
 
     // If no bitmap is supplied by the user, a temporary one will be created.
@@ -184,7 +184,7 @@ public:
         if (style & wxBUFFER_VIRTUAL_AREA)
             window->PrepareDC( m_paintdc );
 
-        Init(&m_paintdc, window->GetClientSize(), style);
+        Init(&m_paintdc, GetBufferedSize(window, style), style);
     }
 
     // default copy ctor ok.
@@ -196,6 +196,15 @@ public:
         UnMask();
     }
 
+protected:
+    // return the size needed by the buffer: this depends on whether we're
+    // buffering just the currently shown part or the total (scrolled) window
+    static wxSize GetBufferedSize(wxWindow *window, int style)
+    {
+        return style & wxBUFFER_VIRTUAL_AREA ? window->GetVirtualSize()
+                                             : window->GetClientSize();
+    }
+
 private:
     wxPaintDC m_paintdc;