[goffice] Fixed GocPolygon bounds. [#605496]



commit c7ec19ad35e4c26788da9003a77de3cb48709177
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Dec 27 10:56:56 2009 +0100

    Fixed GocPolygon bounds. [#605496]

 ChangeLog                    |    5 +++++
 NEWS                         |    1 +
 goffice/canvas/goc-polygon.c |    5 +++--
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 726da23..7001681 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-27  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-polygon.c (goc_polygon_update_bounds): fixed bounds.
+	[#605496]
+
 2009-12-23  Jean Brefort  <jean brefort normalesup org>
 
 	* plugins/plot_xy/gog-xy.c (gog_xy_view_get_data_at_point),
diff --git a/NEWS b/NEWS
index b86303b..06021f4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.7.18:
 
 Jean:
 	* Add a name to regression curves for display in legends. [#605040]
+	* Fixed GocPolygon bounds. [#605496]
 
 --------------------------------------------------------------------------
 goffice 0.7.17:
diff --git a/goffice/canvas/goc-polygon.c b/goffice/canvas/goc-polygon.c
index 6b51ca8..2312d6b 100644
--- a/goffice/canvas/goc-polygon.c
+++ b/goffice/canvas/goc-polygon.c
@@ -105,6 +105,7 @@ goc_polygon_update_bounds (GocItem *item)
 {
 	GocPolygon *polygon = GOC_POLYGON (item);
 	GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
+	/* FIXME: extra_width might be not large enough if angles are small */
 	double extra_width = style->line.width;
 	unsigned i;
 	if (extra_width <= 0.)
@@ -126,8 +127,8 @@ goc_polygon_update_bounds (GocItem *item)
 	}
 	item->x0 -= extra_width;
 	item->y0 -= extra_width;
-	item->x1 -= extra_width;
-	item->y1 -= extra_width;
+	item->x1 += extra_width;
+	item->y1 += extra_width;
 }
 
 static double



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