Skip to content

fix: center relationship labels vertically across browsers (Firefox + Chrome) - #1121

Open
Apageoflove wants to merge 1 commit into
drawdb-io:mainfrom
Apageoflove:fix-relationship-label-vertical-alignment-firefox
Open

fix: center relationship labels vertically across browsers (Firefox + Chrome)#1121
Apageoflove wants to merge 1 commit into
drawdb-io:mainfrom
Apageoflove:fix-relationship-label-vertical-alignment-firefox

Conversation

@Apageoflove

Copy link
Copy Markdown

Summary

Fixes the Firefox vertical alignment issue for relationship labels reported in PR #1106 review.

Changes

  • Use labelPoint.y directly with dominantBaseline="middle" instead of manual labelPoint.y + labelHeight/2 offset
  • Removes labelY and labelHeight variables entirely
  • Works for both composite and simple relationship paths
  • Tested locally in Chrome; would appreciate Firefox verification

Root Cause

The previous approach calculated labelY = labelPoint.y + labelHeight/2 to fake vertical centering, but without dominantBaseline="middle", the text baseline positioning differs between Firefox and Chrome. The correct SVG approach is to set y to the exact center point and use dominantBaseline="middle" to let the browser handle vertical centering consistently.

Closes #1045.

… Chrome)

- Use labelPoint.y directly with dominantBaseline="middle" instead of manual offset
- Fixes Firefox misalignment reported in PR drawdb-io#1106 review
- Works for both composite and simple relationship paths
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

@Apageoflove is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Default in relations label align

1 participant