Re: gnome_canvas_aa bug ???



Hi,
To draw a filled polygon on the AA canvas
you have to create your points in an anticlockwise direction.

So for a square

1---4
|   |
|   |
|   |
2---3

Then it should be filled.

iain
> 
> Hi,
> I am trying to draw figure on canvas.
> I first use an antialiased :
>       
>       gtk_widget_push_visual (gdk_rgb_get_visual ());
>       gtk_widget_push_colormap (gdk_rgb_get_cmap ());
>       canvas = gnome_canvas_new ();
>       gtk_widget_pop_colormap ();
>       gtk_widget_pop_visual ();
>       gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), -10, -10, 300,
> 300);
>       gtk_widget_show (canvas);
>       Draw_in_canvas (GNOME_CANVAS (canvas));
> And in Draw_in_canvas I use :
>       item = gnome_canvas_item_new (group,
>               gnome_canvas_polygon_get_type (),
>               "points", points,
>               "fill_color_rgba", 0X23F5A6FF,
>               "outline_color_rgba", 0X000000FF,
>               "width_pixels", 1,
>               NULL);
> This draw a polygon without filling it.
> If I use a Gdk canvas :
>       gtk_widget_push_visual (gdk_imlib_get_visual ());
>       gtk_widget_push_colormap (gdk_imlib_get_colormap ());
>       canvas = gnome_canvas_new ();
>       gtk_widget_pop_colormap ();
>       gtk_widget_pop_visual ();
>       gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), -10, -10, 300,
> 300);
>       gtk_widget_show (canvas);
>       Draw_in_canvas (GNOME_CANVAS (canvas));
> 
> My figure is filled.
> So is it a bug in antialiased canvas ?
> Is this feature not supported in aa ?
> Am I missing something ?
> -- 
> Florent DEVIN
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]