bug in gnome-canvas-line when using clip_path



Hi,

        I have been using anti-aliased GnomeCanvas with ArtSVP
*clip_path passed in to the group update procedure. In doing this, I
discovered a minor bug in the stock gnome-canvas-line.c item.


        Would it be OK to submit the patch attached below ?

        Second question: clip_path is currently trapped to NULL by the
GnomeCanvas do_update procedure.  Would it OK to add a public member
clip_path and default this to NULL.  This would allow users to the
built-in clipping without the need to create a custom clip group. (Would
make things a little easier I think.)

        Note: I have looked at the stock gnome-canvas-clipgroup item.
This does not solve my problem as it does the clipping during the render
phase.  I need to do the clipping during the update phase for
performance reasons.

Thanks.

Bob Gibbs


Index: gnome-canvas-line.c
===================================================================
RCS file: /cvs/gnome/libgnomecanvas/libgnomecanvas/gnome-canvas-line.c,v
retrieving revision 1.71
diff -u -r1.71 gnome-canvas-line.c
--- gnome-canvas-line.c	3 May 2003 06:47:07 -0000	1.71
+++ gnome-canvas-line.c	14 Nov 2003 11:46:45 -0000
@@ -1072,19 +1072,19 @@
 
 		gnome_canvas_item_update_svp_clip (item, &line->fill_svp, svp,
clip_path);
 
-		if (line->first_arrow && line->first_coords)
+		if (line->first_arrow && line->first_coords) {
 			svp = svp_from_points (line->first_coords, NUM_ARROW_POINTS,
affine);
-		else
-			svp = NULL;
+                        gnome_canvas_item_update_svp_clip (item, 
+                                        &line->first_svp, svp,
clip_path);
+                }
 
-		gnome_canvas_item_update_svp_clip (item, &line->first_svp, svp,
clip_path);
 
-		if (line->last_arrow && line->last_coords)
+		if (line->last_arrow && line->last_coords) {
 			svp = svp_from_points (line->last_coords, NUM_ARROW_POINTS, affine);
-		else
-			svp = NULL;
+                        gnome_canvas_item_update_svp_clip (item, 
+                                        &line->last_svp, svp,
clip_path);
+                }
 
-		gnome_canvas_item_update_svp_clip (item, &line->last_svp, svp,
clip_path);
 
 	} else {
 		set_line_gc_foreground (line);








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