GNOME Bugzilla – Bug 686473
Padding between axis tick and axis label is missing
Last modified: 2012-10-27 20:23:32 UTC
Created attachment 226832 [details] Example, from chart-tests.gnumeric There used to be a padding between ticks and labels on horizontal axis. Now labels can touch ticks, which doesn't look good.
Hmm, in the picture you have attached, none of the labels on the horizonatal axis are touching the ticks. Do you think there should be more space?
Ho. That's because I've saved the file instead of taking a screenshot.
Created attachment 226852 [details] Screenshot
Hmm, so the problem occurs only on screen but not when the graph is saved as a png file... If I open the file in current gnumeric git I see a space between the numbers and the ticks. Do you have the font installed that is specified for those labels. (I am wondering whether through font substitution the fonts used on your screen are slightly higher.
Created attachment 226853 [details] screenshot of the plot on my system using current gnumeric
>> Do you have the font installed that is specified for those labels. Font is set to "Sans", so it depends on the distribution. But no matter the actual font used, code was supposed to measure the ink extents of text, then add a padding between it and ticks. It's may be a position rounding issue.
I'm seeing that too with DejaVu fonts, but not with other fonts.
Created attachment 226887 [details] [review] Proposed patch We actually use the logical size, not the ink size, and add 0.5pt. We might add 1pt instead, or more. Adding 0.5pt to the height and width seems a bit weird anyway. Attached patch adds 1pt.
1pt is a hair. We're basically just adding enough to round to one pixel which will not scale well with increase screen resolution. Can we add, say, 15% of the tick length? If not, perhaps 15% of the height of something like "0123456789".
15% of the tick lentgh might be bad in some cases (if this length is nul). 15% of a string height looks better. Or 10% of the font size (looks easier).
Created attachment 227396 [details] [review] New patch Looks like we actually had an horizontal padding (the width of "0"), but no vertical padding. As this code went almost unchanged since a long time, I'm suspecting that this has always been the case. Proposed patch adds 15% of "0" height to the tick length when positioning the label, but removes the previous horizontal padding. Emmanuel, Morten, do you agree with that solution?
Patch looks ok to me visually, except for the // comment.
Committed.