Index: dia/lib/beziershape.c
===================================================================
RCS file: /cvs/gnome/dia/lib/beziershape.c,v
retrieving revision 1.22
diff -u -w -r1.22 beziershape.c
--- dia/lib/beziershape.c	3 Apr 2005 21:34:15 -0000	1.22
+++ dia/lib/beziershape.c	19 Apr 2005 06:00:18 -0000
@@ -704,10 +704,10 @@
     pextra.start_long = pextra.end_long = 0;
   pextra.middle_trans = extra->border_trans;
 
-  polybezier_bbox(&bezier->points[0],
+  beziergon_bbox(&bezier->points[0],
                   bezier->numpoints,
-                  &pextra, TRUE,
                   &bezier->object.bounding_box);
+
 }
 
 void
Index: dia/lib/boundingbox.c
===================================================================
RCS file: /cvs/gnome/dia/lib/boundingbox.c,v
retrieving revision 1.4
diff -u -w -r1.4 boundingbox.c
--- dia/lib/boundingbox.c	27 May 2001 18:46:35 -0000	1.4
+++ dia/lib/boundingbox.c	19 Apr 2005 06:00:19 -0000
@@ -88,6 +88,29 @@
   rectangle_add_point(rect,&pt);  
 }
                          
+/* a beziergon shape is always enclosed in a rect formed by its four control points*/                         
+void 
+beziergon_bbox(const BezPoint *pts, int numpoints,
+               Rectangle *rect)
+{
+  int i;
+  Point ctr1;
+  Point ctr2;
+
+  rect->left = rect->right = pts[0].p1.x;
+  rect->top = rect->bottom = pts[0].p1.y;
+
+  for (i=1;i<numpoints;i++) {
+    ctr1.y = MIN(pts[i].p2.y, MIN(pts[i].p1.y, pts[i].p3.y));
+    ctr1.x = MIN(pts[i].p2.x, MIN(pts[i].p1.x, pts[i].p3.x));
+    ctr2.y = MAX(pts[i].p2.y, MAX(pts[i].p1.y, pts[i].p3.y));
+    ctr2.x = MAX(pts[i].p2.x, MAX(pts[i].p1.x, pts[i].p3.x));
+
+    rectangle_add_point(rect,&ctr1);
+    rectangle_add_point(rect,&ctr2);
+  }
+}
+
 void 
 bicubicbezier2D_bbox(const Point *p0,const Point *p1,
                      const Point *p2,const Point *p3,
Index: dia/lib/boundingbox.h
===================================================================
RCS file: /cvs/gnome/dia/lib/boundingbox.h,v
retrieving revision 1.3
diff -u -w -r1.3 boundingbox.h
--- dia/lib/boundingbox.h	8 Oct 2002 02:23:51 -0000	1.3
+++ dia/lib/boundingbox.h	19 Apr 2005 06:00:19 -0000
@@ -38,6 +38,10 @@
   real border_trans;
 };
 
+void
+beziergon_bbox(const BezPoint *pts, int numpoints,
+               Rectangle *rect);
+
 void bicubicbezier2D_bbox(const Point *p0,const Point *p1,
                           const Point *p2,const Point *p3,
                           const PolyBBExtras *extra,
