Skip to content

Conversation

@seveibar
Copy link
Contributor

Summary

  • scale projected line stroke widths by the transformation matrix when emitting SVG
  • update the line SVG test to assert scaled widths and add a stable snapshot for the transformed polylines

Testing

  • BUN_UPDATE_SNAPSHOTS=1 bun test tests/getSvgFromGraphicsObject.test.ts
  • bun test tests/getSvgFromGraphicsObject.test.ts
  • bunx tsc --noEmit

Codex Task

@vercel
Copy link

vercel bot commented Nov 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
graphics-debug Ready Ready Preview Comment Nov 15, 2025 2:17am

svgWidth,
svgHeight,
)
const strokeScale = Math.hypot(matrix.a, matrix.b)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const strokeScale = Math.hypot(matrix.a, matrix.b)
const strokeScale = Math.abs(matrix.a)

@seveibar seveibar merged commit 824a94c into main Nov 15, 2025
3 checks passed
@seveibar seveibar deleted the codex/add-svg-snapshot-test-for-line-scaling branch November 15, 2025 02:17
@tscircuitbot
Copy link


Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants