Skip to content

Conversation

fzaman-linz
Copy link

Improves the precision of label bounding box calculations and rendering by introducing new style properties and refining label metrics handling.

  • text-metrics (default | actual)
    Allows to choose between browser-default text metrics or actual font metrics (actualBoundingBoxAscent / Descent) for more accurate label height calculations.

  • bbox-margin-error-x / bbox-margin-error-y
    Provides fine-grained control over bounding box expansion to compensate for browser rendering inaccuracies. These replace the previous hardcoded marginOfError.

Label Dimension Calculation Enhancements

  • calculateLabelDimensions() now supports text-metrics: actual, using actualBoundingBoxAscent and actualBoundingBoxDescent for more precise vertical alignment and height.

Checklist

Author:

  • The proper base branch has been selected. New features go on unstable. Bug-fix patches can go on either unstable or master.
  • Automated tests have been included in this pull request, if possible, for the new feature(s) or bug fix. Check this box if tests are not pragmatically possible (e.g. rendering features could include screenshots or videos instead of automated tests).
  • The associated GitHub issues are included (above).
  • Notes have been included (above).
  • For new or updated API, the index.d.ts Typescript definition file has been appropriately updated.

Reviewers:

  • All automated checks are passing (green check next to latest commit).
  • At least one reviewer has signed off on the pull request.
  • For bug fixes: Just after this pull request is merged, it should be applied to both the master branch and the unstable branch. Normally, this just requires cherry-picking the corresponding merge commit from master to unstable -- or vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant