X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c3ebf8be5f192f23d8266603a72d19a7267c7c5..528a5e8f92e938407ee2c33b29e519af064e6608:/src/common/dcbase.cpp diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 34b410ab11..08d7d49e2b 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/dcbase.cpp +// Name: src/common/dcbase.cpp // Purpose: generic methods of the wxDC Class // Author: Vadim Zeitlin // Modified by: @@ -25,14 +25,23 @@ #endif #include "wx/dc.h" -#include "wx/math.h" +#include "wx/dcbuffer.h" // for IMPLEMENT_DYNAMIC_CLASS + +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif // bool wxDCBase::sm_cacheing = false; +IMPLEMENT_ABSTRACT_CLASS(wxDCBase, wxObject) + // ============================================================================ // implementation // ============================================================================ +IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC, wxMemoryDC) +IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC, wxBufferedDC) + #if WXWIN_COMPATIBILITY_2_6 void wxDCBase::BeginDrawing() { @@ -321,7 +330,7 @@ void wxDCBase::DoDrawSpline( wxList *points ) double x1, y1, x2, y2; wxList::compatibility_iterator node = points->GetFirst(); - if (node == wxList::compatibility_iterator()) + if (!node) // empty list return; @@ -412,7 +421,7 @@ bool wxDCBase::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) { int totalWidth = 0; - const size_t len = text.Length(); + const size_t len = text.length(); widths.Empty(); widths.Add(0, len); @@ -771,7 +780,7 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect, SetPen(oldPen); } -void wxDCBase::GradientFillConcentric(const wxRect& rect, +void wxDCBase::DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter) @@ -817,9 +826,9 @@ void wxDCBase::GradientFillConcentric(const wxRect& rect, nGradient = 0; //get dest colors - nR = nR1 + ((nR2 - nR1) * nGradient / 100); - nG = nG1 + ((nG2 - nG1) * nGradient / 100); - nB = nB1 + ((nB2 - nB1) * nGradient / 100); + nR = (wxUint8)(nR1 + ((nR2 - nR1) * nGradient / 100)); + nG = (wxUint8)(nG1 + ((nG2 - nG1) * nGradient / 100)); + nB = (wxUint8)(nB1 + ((nB2 - nB1) * nGradient / 100)); //set the pixel m_pen.SetColour(wxColour(nR,nG,nB)); @@ -1141,4 +1150,3 @@ void wxDCBase::CalculateEllipticPoints( wxList* points, } // CalculateEllipticPoints #endif -