Code

when walking the bytes use the pitch not the width
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 2 May 2005 19:47:05 +0000 (19:47 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 2 May 2005 19:47:05 +0000 (19:47 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@477 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_gfx.c

index 015070637aefe9da5053ee8fbca30854d2dd2f35..cdb92e103f0625c791e22ef06e04b68d18c487c4 100644 (file)
@@ -658,7 +658,7 @@ int           gfx_render_png (gfx_canvas_t *canvas,
                         
                         if (buf_x < 0 || buf_x >= (long)pys_width) continue;
                         buf_x *=  bytes_per_pixel ;
-                        font_alpha =  *(bit->bitmap.buffer + iy * bit->bitmap.width + ix);
+                        font_alpha =  *(bit->bitmap.buffer + iy * bit->bitmap.pitch + ix);
                        if (font_alpha > 0){
                                fcolor[3] =  (art_u8)((double)font_alpha / gr * falpha);
                                art_rgba_rgba_composite(buffer + buf_y + buf_x ,fcolor,1);