After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667152 - incorrect rendering of underlined rotated text
incorrect rendering of underlined rotated text
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-01-02 21:12 UTC by Andreas J. Guelzow
Modified: 2012-01-06 21:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample file (8.94 KB, application/gnumeric)
2012-01-02 21:12 UTC, Andreas J. Guelzow
  Details
Tentative patch (1.94 KB, patch)
2012-01-02 22:52 UTC, Morten Welinder
none Details | Review

Description Andreas J. Guelzow 2012-01-02 21:12:45 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.
Comment 1 Morten Welinder 2012-01-02 22:01:13 UTC
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.
Comment 2 Morten Welinder 2012-01-02 22:16:13 UTC
Note, that it looks ok in print preview.
Comment 3 Andreas J. Guelzow 2012-01-02 22:28:02 UTC
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.
Comment 4 Morten Welinder 2012-01-02 22:52:07 UTC
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.
Comment 5 Andreas J. Guelzow 2012-01-02 23:25:37 UTC
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.
Comment 6 Morten Welinder 2012-01-02 23:46:06 UTC
Adding Jean for possible comments (to patch from comment 4).
Comment 7 Morten Welinder 2012-01-03 14:34:40 UTC
I have committed the bug-fixing part of the patch.  Keeping open for
deciding whether to remove what I think is not needed.
Comment 8 Andreas J. Guelzow 2012-01-03 18:59:27 UTC
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
Comment 9 Morten Welinder 2012-01-03 19:07:47 UTC
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.
Comment 10 Jean Bréfort 2012-01-06 10:05:13 UTC
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).
Comment 11 Morten Welinder 2012-01-06 21:05:39 UTC
- 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.
Comment 12 Morten Welinder 2012-01-06 21:09:16 UTC
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.