[gnumeric] GUI: Fix drawing of rotated and underlines cells.



commit e42eee29a2c7485b7b903fb9634b463c8ec053b3
Author: Morten Welinder <terra gnome org>
Date:   Tue Jan 3 09:33:33 2012 -0500

    GUI: Fix drawing of rotated and underlines cells.

 ChangeLog       |    5 +++++
 NEWS            |    1 +
 src/cell-draw.c |   16 +++++++++-------
 3 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ba7f858..fe080b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-03  Morten Welinder  <terra gnome org>
+
+	* src/cell-draw.c (cell_draw): Fix problems with underlines and
+	rotated cells.  [#667152]
+
 2012-01-01  Morten Welinder  <terra gnome org>
 
 	* src/workbook-view.h (WorkbookView): Rework to track a cell in a
diff --git a/NEWS b/NEWS
index 6f6bdb7..08a2f18 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Morten:
 	* Fix auto-expression problem with sheet deletion.
 	* Fix ellipsizing of auto-expression.
 	* Fix auto-expression of single cell when moved.
+	* Fix problems with underlines and rotated cells.  [#667152]
 
 --------------------------------------------------------------------------
 Gnumeric 1.11.1
diff --git a/src/cell-draw.c b/src/cell-draw.c
index a4670a2..81518e9 100644
--- a/src/cell-draw.c
+++ b/src/cell-draw.c
@@ -406,11 +406,6 @@ cell_draw (GnmCell const *cell, cairo_t *cr,
 			      h_center == -1 ? -1 : (h_center * PANGO_SCALE),
 			      &fore_color, &x, &y)) {
 
-		/* +1 to get past left grid-line.  */
-		cairo_rectangle (cr, x1 + 1 + GNM_COL_MARGIN,
-				 y1 + 1 + GNM_ROW_MARGIN,
-				 width, height);
-
 		cairo_save (cr);
 
 		/*
@@ -418,8 +413,15 @@ cell_draw (GnmCell const *cell, cairo_t *cr,
 		 * approximation to the right effect.  (The right way
 		 * would be to create a proper cellspan type.)
 		 */
-		if (!rv->rotation)
+		if (!rv->rotation) {
+			cairo_new_path (context);
+			/* +1 to get past left grid-line.  */
+			cairo_rectangle (cr, x1 + 1 + GNM_COL_MARGIN,
+					 y1 + 1 + GNM_ROW_MARGIN,
+					 width, height);
+
 			cairo_clip (cr);
+		}
 
 		/* See http://bugzilla.gnome.org/show_bug.cgi?id=105322 */
 		cairo_set_source_rgba (cr, GO_COLOR_TO_CAIRO (fore_color));
@@ -437,7 +439,7 @@ cell_draw (GnmCell const *cell, cairo_t *cr,
 			     lines = lines->next, li++) {
 				cairo_save (cr);
 				cairo_move_to (cr, x1 + PANGO_PIXELS (x + li->dx), y1 + PANGO_PIXELS (y + li->dy));
-				cairo_rotate (cr, -rv->rotation * M_PI / 180);
+				cairo_rotate (cr, rv->rotation * (-M_PI / 180));
 				pango_cairo_show_layout_line (cr, lines->data);
 				cairo_restore (cr);
 			}



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