]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
use image mask colour if any instead of guessing that (0, 0) is always transparent...
[wxWidgets.git] / src / common / dcbase.cpp
index 10c928e505c681fa176609d038e94e9560a5bfd2..1beb8edcae184a1f75c519222fdc2d04ebeeef6f 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "wx/dc.h"
 
-#include <math.h>
-
 // bool wxDCBase::sm_cacheing = false;
 
 // ============================================================================
@@ -316,6 +314,10 @@ void wxDCBase::DoDrawSpline( wxList *points )
     double           x1, y1, x2, y2;
 
     wxList::compatibility_iterator node = points->GetFirst();
+    if (node == wxList::compatibility_iterator())
+        // empty list
+        return;
+
     p = (wxPoint *)node->GetData();
 
     x1 = p->x;
@@ -762,7 +764,7 @@ void wxDCBase::Rotate( wxList* points, double angle, wxPoint center )
 {
     if( angle != 0.0 )
     {
-        double pi(3.1415926536);
+        double pi(M_PI);
         double dSinA = -sin(angle*2.0*pi/360.0);
         double dCosA = cos(angle*2.0*pi/360.0);
         for ( wxNode* node = points->First(); node; node = node->Next() )
@@ -790,7 +792,7 @@ void wxDCBase::CalculateEllipticPoints( wxList* points,
                                         wxCoord w, wxCoord h,
                                         double sa, double ea )
 {
-    double pi = 3.1415926535;
+    double pi = M_PI;
     double sar = 0;
     double ear = 0;
     int xsa = 0;