Moodle

Graph lib text alignment issue

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.6
  • Fix Version/s: 1.9.7
  • Component/s: Libraries
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The text alignment code in graphlib has a bug that messes up the alignment of x axis lables when some have descenders, like 'May', and others don't, like 'Jun'.

The issue is that gd draws text base-line aligned, but the graphlib measurement code measures to the bottom of the bounding box, not the baseline of the text.

I think the attached simple patch is the correct fix.

Activity

Hide
Martin Dougiamas added a comment -

Looks good, if it works for you I say check it in! Thanks!

Show
Martin Dougiamas added a comment - Looks good, if it works for you I say check it in! Thanks!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: