From 78bb4cdace43829b1e10f359ddee1affcfd64148 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 9 Apr 2014 18:26:20 -0400 Subject: Fixed Area drawing assuming the first pixel of the *image.NRGBA is at i.Pix[0]. --- area_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'area_unix.go') diff --git a/area_unix.go b/area_unix.go index d9ca2d2..926166f 100644 --- a/area_unix.go +++ b/area_unix.go @@ -60,7 +60,7 @@ func our_area_draw_callback(widget *C.GtkWidget, cr *C.cairo_t, data C.gpointer) // pixel order is [R G B A] (see Example 1 on https://developer.gnome.org/gdk-pixbuf/2.26/gdk-pixbuf-The-GdkPixbuf-Structure.html) so we don't have to convert anything // gdk-pixbuf is not alpha-premultiplied (thanks to desrt in irc.gimp.net/#gtk+) pixbuf := C.gdk_pixbuf_new_from_data( - (*C.guchar)(unsafe.Pointer(&i.Pix[0])), + (*C.guchar)(unsafe.Pointer(pixelData(i))), C.GDK_COLORSPACE_RGB, C.TRUE, // has alpha channel 8, // bits per sample -- cgit v1.2.3