misaligned rotated text
Submitted by an unknown user
Link to original bug (#602777)
Description
Created attachment 148346 a sample file showing the issue, the content of C1 is displayed in B1
When a cell contains rotated text and borders, and is right or center aligned, it is not displayed where it should.
There are actually two issues operating there. First, it seems that cell_calc_span is provided a too large width to fit inside the cell, so it tries to spread the cell on the empty neighbors, and the cell_calc_layout does not take horizontal alignment into account when the cell has a border and rotated text. The code is:
if (rv->rotation && !rv->noborders) { GnmRenderedRotatedValue const *rrv = (GnmRenderedRotatedValue *)rv; double sin_a = rrv->rotmat.xy; if (sin_a < 0) { hoffset += (width - indent) - rv->layout_natural_width; } } else ...
Commenting out this code puts the text at a better position, but I suppose it is there to fix something else, so I don't know what should be done.
Attachment 148346, "a sample file showing the issue, the content of C1 is displayed in B1":
textposbug.gnumeric
Version: git master