GNOME Bugzilla – Bug 667152
incorrect rendering of underlined rotated text
Last modified: 2012-01-06 21:09:16 UTC
Created attachment 204473 [details] sample file A cell with underlined text rotated 45 degrees is rendered incorrectly (the cell appears to develop a black background). See attached sample file.
Commenting out pango_cairo_show_layout_line (cr, lines->data); in cell_draw() makes the black box go away. (And the text, of course.) This smells like a pango problem.
Note, that it looks ok in print preview.
Also, in the sample file the whole cell text is underlined. THe same effect can be obtained by just underlining a single character in that cell.
Created attachment 204476 [details] [review] Tentative patch This seems to fix matters. The part that really matters is to move the rectangle underneath the clip condition. Any idea what the rest of the stuff deleted was? It isn't in print-cell.c's version and it doesn't seem to make a difference.
This patch seems to work for me. I see no ill effect of deleting those lines, but Jean might have an idea. I do note that changing style (italic,bold,underline) fails to redraw the part of the text that sticks out of the cell boundary. But that was also true in 1.10.17.
Adding Jean for possible comments (to patch from comment 4).
I have committed the bug-fixing part of the patch. Keeping open for deciding whether to remove what I think is not needed.
Morten, your partial commit does not work: CC libspreadsheet_la-cell-draw.lo cell-draw.c: In function 'cell_draw': cell-draw.c:417:20: error: 'context' undeclared (first use in this function) cell-draw.c:417:20: note: each undeclared identifier is reported only once for each function it appears in
Sorry, fixed. I added that line to match print-cell.c and because it looks right. I must have saved during the compile, because make was happy.
Why that? Am I missing the obvious? - cairo_rotate (cr, -rv->rotation * M_PI / 180); + cairo_rotate (cr, rv->rotation * (-M_PI / 180)); The PangoContext related code dates from before the move to cairo. It is probably useless these days. As far as I remember, I added a call to cairo_new_path because in some circumstances unwanted lines appeared otherwise. But I don't know why it is only used in the rotated case. You can remove it, we'll see if the bug reappears (might have been fixed in pangocairo).
- cairo_rotate (cr, -rv->rotation * M_PI / 180); + cairo_rotate (cr, rv->rotation * (-M_PI / 180)); That was just moving stuff around to make it match print-cell.c. No difference expected beyond possible last-bit rounding issues. I'll kill the remainder.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.