Skip to content

fix(block-ui): center PDF net labels - #178

Open
Sang-it wants to merge 3 commits into
mainfrom
codex/fix-pdf-net-label-alignment
Open

fix(block-ui): center PDF net labels#178
Sang-it wants to merge 3 commits into
mainfrom
codex/fix-pdf-net-label-alignment

Conversation

@Sang-it

@Sang-it Sang-it commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Before: Screenshot 2026-08-27 at 3 03 58 PM After:Screenshot 2026-08-27 at 3 43 53 PM

  • mirror SVG dominant-baseline into alignment-baseline before svg2pdf conversion
  • compensate jsPDF central-baseline placement by 0.08em in text-local coordinates
  • preserve explicit alignment and dy positioning across text and tspan elements
  • isolate the compatibility workaround in a focused, independently tested module

Why

svg2pdf.js ignores dominant-baseline, while jsPDF renders the mapped middle baseline slightly above the browser SVG position. Together these differences vertically offset generated PDF net labels.

Testing

  • bun run format:check
  • bun run typecheck
  • bun test
  • bun run build

svg2pdf ignores dominant-baseline and reads alignment-baseline. Mirror the value during export without overriding explicit alignment.
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ti-system-block-ui Ready Ready Preview Aug 27, 2026 10:47pm

Request Review

jsPDF renders its middle baseline above the browser SVG position. Apply an em-relative correction without overriding explicit dy values.
Keep the SVG compatibility logic isolated and apply the visually verified 0.08em central-baseline correction.
@Sang-it
Sang-it marked this pull request as ready for review August 27, 2026 22:49
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.

1 participant