GnomeCanvasShape patch



this patch fixes some warnings i get with the gnome druid.

is this right, or is the druid broken?

jacob
-- 
"In fact, can you imagine anything more terrifying than a zombie clown?"
	-- moby
Index: gnome-canvas-shape.c
===================================================================
RCS file: /cvs/gnome/libgnomecanvas/libgnomecanvas/gnome-canvas-shape.c,v
retrieving revision 1.11
diff -u -r1.11 gnome-canvas-shape.c
--- gnome-canvas-shape.c	2002/01/05 06:09:40	1.11
+++ gnome-canvas-shape.c	2002/01/08 21:01:57
@@ -1055,106 +1055,107 @@
 		gnome_canvas_item_reset_bounds (item);
 	
 	/* Clipped fill SVP */
-
-	if ((shape->priv->fill_set) && (gnome_canvas_path_def_any_closed (shape->priv->path))) {
-		GnomeCanvasPathDef * cpath;
-		ArtBpath * abp;
-		ArtVpath * vpath, * pvpath;
-		ArtSVP *tmp_svp;
-
-		/* Get closed part of path */
-
-		cpath = gnome_canvas_path_def_closed_parts (shape->priv->path);
-		abp = art_bpath_affine_transform (gnome_canvas_path_def_bpath (cpath), affine);
-		gnome_canvas_path_def_unref (cpath);
-
-		/* Render, until SVP */
-
-		vpath = art_bez_path_to_vec (abp, 0.1);
-		art_free (abp);
-
-		pvpath = art_vpath_perturb (vpath);
-		art_free (vpath);
-
-		svp = art_svp_from_vpath (pvpath);
-		art_free (pvpath);
-		
-		tmp_svp = art_svp_uncross (svp);
-		art_svp_free (svp);
-
-		svp = art_svp_rewind_uncrossed (tmp_svp, shape->priv->wind);
-		art_svp_free (tmp_svp);
-
-		if (item->canvas->aa) {
-
-			/* Update clipped path */
-
-			gnome_canvas_item_update_svp_clip (item,
-				&shape->priv->fill_svp,
-				svp,
-				clip_path);
-		} else {
-
-			/* No clipping */
-			shape->priv->fill_svp = svp;
-		}
-	}
-
-	if ((priv->outline_set) && (!gnome_canvas_path_def_is_empty (priv->path))) {
-		gdouble width;
-		ArtBpath * abp;
-		ArtVpath * vpath, * pvpath;
-
-		/* Set linewidth */
-
-		if (priv->width_pixels) {
-			width = priv->width;
-		} else {
-			width = priv->width * priv->scale;
-		}
-		
-		if (width < 0.5) width = 0.5;
-		
-		/* Render full path until vpath */
-
-		abp = art_bpath_affine_transform (gnome_canvas_path_def_bpath (priv->path), affine);
-
-		vpath = art_bez_path_to_vec (abp, 0.1);
-		art_free (abp);
-
-		pvpath = art_vpath_perturb (vpath);
-		art_free (vpath);
-
-		/* If dashed, apply dash */
-
-		if (priv->dash.dash != NULL)
-		{
-			ArtVpath *old = pvpath;
+	if (priv->path) {
+		if ((shape->priv->fill_set) && (gnome_canvas_path_def_any_closed (priv->path))) {
+			GnomeCanvasPathDef * cpath;
+			ArtBpath * abp;
+			ArtVpath * vpath, * pvpath;
+			ArtSVP *tmp_svp;
+			
+			/* Get closed part of path */
+			
+			cpath = gnome_canvas_path_def_closed_parts (shape->priv->path);
+			abp = art_bpath_affine_transform (gnome_canvas_path_def_bpath (cpath), affine);
+			gnome_canvas_path_def_unref (cpath);
+			
+			/* Render, until SVP */
+			
+			vpath = art_bez_path_to_vec (abp, 0.1);
+			art_free (abp);
+			
+			pvpath = art_vpath_perturb (vpath);
+			art_free (vpath);
+			
+			svp = art_svp_from_vpath (pvpath);
+			art_free (pvpath);
+			
+			tmp_svp = art_svp_uncross (svp);
+			art_svp_free (svp);
+			
+			svp = art_svp_rewind_uncrossed (tmp_svp, shape->priv->wind);
+			art_svp_free (tmp_svp);
 			
-			pvpath = art_vpath_dash (old, &priv->dash);
-			art_free (old);
+			if (item->canvas->aa) {
+				
+				/* Update clipped path */
+				
+				gnome_canvas_item_update_svp_clip (item,
+								   &shape->priv->fill_svp,
+								   svp,
+								   clip_path);
+			} else {
+				
+				/* No clipping */
+				shape->priv->fill_svp = svp;
+			}
 		}
 		
-		/* Stroke vpath to SVP */
-
-		svp = art_svp_vpath_stroke (pvpath,
-					    gnome_canvas_join_gdk_to_art (priv->join),
-					    gnome_canvas_cap_gdk_to_art (priv->cap),
-					    width,
-					    priv->miterlimit,
-					    0.25);
-		art_free (pvpath);
-
-		if (item->canvas->aa) {
-
-			/* Update clipped */
-
-			gnome_canvas_item_update_svp_clip (item, &priv->outline_svp, svp, clip_path);
-
-		} else {
-
-			/* No clipping (yet) */
-			shape->priv->outline_svp = svp;
+		if ((priv->outline_set) && (!gnome_canvas_path_def_is_empty (priv->path))) {
+			gdouble width;
+			ArtBpath * abp;
+			ArtVpath * vpath, * pvpath;
+			
+			/* Set linewidth */
+			
+			if (priv->width_pixels) {
+				width = priv->width;
+			} else {
+				width = priv->width * priv->scale;
+			}
+			
+			if (width < 0.5) width = 0.5;
+			
+			/* Render full path until vpath */
+			
+			abp = art_bpath_affine_transform (gnome_canvas_path_def_bpath (priv->path), affine);
+			
+			vpath = art_bez_path_to_vec (abp, 0.1);
+			art_free (abp);
+			
+			pvpath = art_vpath_perturb (vpath);
+			art_free (vpath);
+			
+			/* If dashed, apply dash */
+			
+			if (priv->dash.dash != NULL)
+			{
+				ArtVpath *old = pvpath;
+				
+				pvpath = art_vpath_dash (old, &priv->dash);
+				art_free (old);
+			}
+			
+			/* Stroke vpath to SVP */
+			
+			svp = art_svp_vpath_stroke (pvpath,
+						    gnome_canvas_join_gdk_to_art (priv->join),
+						    gnome_canvas_cap_gdk_to_art (priv->cap),
+						    width,
+						    priv->miterlimit,
+						    0.25);
+			art_free (pvpath);
+			
+			if (item->canvas->aa) {
+				
+				/* Update clipped */
+				
+				gnome_canvas_item_update_svp_clip (item, &priv->outline_svp, svp, clip_path);
+				
+			} else {
+				
+				/* No clipping (yet) */
+				shape->priv->outline_svp = svp;
+			}
 		}
 	}
 


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