Skip to content

Fix mouse coordinates under CSS scale transforms - #6047

Open
chen-985211 wants to merge 2 commits into
xtermjs:masterfrom
chen-985211:codex/fix-scaled-mouse-coordinates
Open

Fix mouse coordinates under CSS scale transforms#6047
chen-985211 wants to merge 2 commits into
xtermjs:masterfrom
chen-985211:codex/fix-scaled-mouse-coordinates

Conversation

@chen-985211

@chen-985211 chen-985211 commented Jul 13, 2026

Copy link
Copy Markdown

Fixes #6023

Summary

  • derive CSS scale factors from the transformed and layout dimensions
  • invert positive axis-aligned scaling before applying terminal padding
  • add unit coverage for scale down, scale up, non-uniform scale, padding, and zero-size fallback
  • add a browser regression test for mouse tracking under an ancestor scale transform

Tests

  • npm run build && npm run esbuild
  • npm run test-unit -- out-esbuild/browser/input/Mouse.test.js
  • npm run esbuild-demo-client && npm run esbuild-demo-server
  • npm run test-integration -- --suite=core --project=Chromium test/playwright/MouseTracking.test.ts
  • npm run lint-changes

@chen-985211
chen-985211 marked this pull request as draft July 14, 2026 11:20
@chen-985211
chen-985211 marked this pull request as ready for review July 14, 2026 11:20
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.

Mouse hit-test still uses post-transform getBoundingClientRect after #2488 made char measurement transform-agnostic

1 participant