make transparent backgrounds work propperly
[rrdtool.git] / src / rrd_graph.c
index f508cf5..a399491 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "rrd_tool.h"
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
 #include <io.h>
 #include <fcntl.h>
 #endif
@@ -2387,11 +2387,11 @@ graph_paint(image_desc_t *im, char ***calcpr)
   
   node=gfx_new_area ( im->canvas,
                       0, 0,
-                      im->ximg, 0,
-                      im->ximg, im->yimg,
+                      0, im->yimg,
+                     im->ximg, im->yimg,                      
                       im->graph_col[GRC_BACK]);
 
-  gfx_add_point(node,0, im->yimg);
+  gfx_add_point(node,im->ximg, 0);
 
 #ifdef WITH_PIECHART
   if (piechart != 2) {
@@ -2634,7 +2634,7 @@ graph_paint(image_desc_t *im, char ***calcpr)
   
   if (strcmp(im->graphfile,"-")==0) {
     fo = im->graphhandle ? im->graphhandle : stdout;
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
     /* Change translation mode for stdout to BINARY */
     _setmode( _fileno( fo ), O_BINARY );
 #endif
@@ -2645,7 +2645,7 @@ graph_paint(image_desc_t *im, char ***calcpr)
       return (-1);
     }
   }
-  gfx_render (im->canvas,im->ximg,im->yimg,0x0,fo);
+  gfx_render (im->canvas,im->ximg,im->yimg,0x00000000,fo);
   if (strcmp(im->graphfile,"-") != 0)
     fclose(fo);
   return 0;
@@ -2839,7 +2839,7 @@ rrd_graph_init(image_desc_t *im)
     for(i=0;i<DIM(graph_col);i++)
         im->graph_col[i]=graph_col[i];
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
     {
             char *windir; 
            char rrd_win_default_font[1000];