[goffice] fixed rounding to int.



commit 7a5758db7337459e8b2c4e48964e5bb673eb1bf6
Author: Jean Brefort <jean brefort normalesup org>
Date:   Fri Dec 18 15:43:31 2009 +0100

    fixed rounding to int.

 ChangeLog                   |    4 ++++
 goffice/canvas/goc-canvas.c |    6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ff2b7d0..b7b431b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-18  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-canvas.c (goc_canvas_c2w): fixed rounding to int.
+
 2009-12-05  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/goffice/canvas/goc-canvas.c b/goffice/canvas/goc-canvas.c
index 8baf4b5..9a205e2 100644
--- a/goffice/canvas/goc-canvas.c
+++ b/goffice/canvas/goc-canvas.c
@@ -609,10 +609,10 @@ goc_canvas_c2w (GocCanvas *canvas, double x, double y, int *x_, int *y_)
 {
 	if (x_) {
 		if (canvas->direction == GOC_DIRECTION_RTL)
-			*x_ = canvas->width - (x - canvas->scroll_x1) * canvas->pixels_per_unit;
+			*x_ = go_fake_round (canvas->width - (x - canvas->scroll_x1) * canvas->pixels_per_unit);
 		else
-			*x_ = (x - canvas->scroll_x1) * canvas->pixels_per_unit;
+			*x_ = go_fake_round ((x - canvas->scroll_x1) * canvas->pixels_per_unit);
 	}
 	if (y_)
-		*y_ = (y - canvas->scroll_y1) * canvas->pixels_per_unit;
+		*y_ = go_fake_round ((y - canvas->scroll_y1) * canvas->pixels_per_unit);
 }



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