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 686473 - Padding between axis tick and axis label is missing
Padding between axis tick and axis label is missing
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Charting
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-10-19 15:34 UTC by Emmanuel Pacaud
Modified: 2012-10-27 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example, from chart-tests.gnumeric (48.98 KB, image/png)
2012-10-19 15:34 UTC, Emmanuel Pacaud
  Details
Screenshot (25.59 KB, image/png)
2012-10-19 19:29 UTC, Emmanuel Pacaud
  Details
screenshot of the plot on my system using current gnumeric (33.14 KB, image/png)
2012-10-19 19:43 UTC, Andreas J. Guelzow
  Details
Proposed patch (1.30 KB, patch)
2012-10-20 12:34 UTC, Jean Bréfort
none Details | Review
New patch (3.77 KB, patch)
2012-10-27 08:44 UTC, Jean Bréfort
none Details | Review

Description Emmanuel Pacaud 2012-10-19 15:34:19 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.
Comment 1 Andreas J. Guelzow 2012-10-19 18:40:31 UTC
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?
Comment 2 Emmanuel Pacaud 2012-10-19 19:29:32 UTC
Ho. That's because I've saved the file instead of taking a screenshot.
Comment 3 Emmanuel Pacaud 2012-10-19 19:29:53 UTC
Created attachment 226852 [details]
Screenshot
Comment 4 Andreas J. Guelzow 2012-10-19 19:41:31 UTC
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.
Comment 5 Andreas J. Guelzow 2012-10-19 19:43:17 UTC
Created attachment 226853 [details]
screenshot of the plot on my system using current gnumeric
Comment 6 Emmanuel Pacaud 2012-10-19 19:58:49 UTC
>> 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.
Comment 7 Jean Bréfort 2012-10-19 20:24:48 UTC
I'm seeing that too with DejaVu fonts, but not with other fonts.
Comment 8 Jean Bréfort 2012-10-20 12:34:20 UTC
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.
Comment 9 Morten Welinder 2012-10-20 19:38:01 UTC
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".
Comment 10 Jean Bréfort 2012-10-27 07:05:14 UTC
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).
Comment 11 Jean Bréfort 2012-10-27 08:44:47 UTC
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?
Comment 12 Morten Welinder 2012-10-27 12:06:25 UTC
Patch looks ok to me visually, except for the // comment.
Comment 13 Morten Welinder 2012-10-27 20:23:32 UTC
Committed.