Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment issues with translations in editor display when zooming in and out #1501

Open
kseniaryzhova opened this issue Dec 6, 2023 · 2 comments
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant

Comments

@kseniaryzhova
Copy link

Describe the bug
Misalignment of the English translation when side-by-side with the transcription. It appears as though the lines are doubled up, so the text from the line below is just superimposed over the first line, making it illegible.

To reproduce
Steps to reproduce the behavior:

  1. Go to public search.
  2. Search for documents with a digital transcription and a digital translation.
  3. In the module, open up the transcription and translation side by side.
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

image (7)

Device information

  • MR is using Safari 17.1. KR had no issues on PC. Ben could not reproduce initially.
@kseniaryzhova kseniaryzhova added 🐛 bug Something isn't working performant Tasks for or taken on by Performant labels Dec 6, 2023
@blms blms changed the title Alignment issues with translations in editor display (related to Safari 17.1) Alignment issues with translations in editor display when zooming in and out Feb 28, 2024
@blms
Copy link
Contributor

blms commented Feb 28, 2024

Turns out this is related to zooming in and out with the browser. The line heights are hard coded to a number of pixels, so the alignment fails when the pixel numbers are changed by zoom.

Workaround until fix is to zoom back to normal zoom (Cmd 0 on Mac or Ctrl 0 on windows).

@blms
Copy link
Contributor

blms commented Feb 28, 2024

It's surprisingly difficult to get an accurate height for an element when the browser has been zoomed in.

This might help, but it's not yet supported in Safari:
https://web.dev/articles/device-pixel-content-box
https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize

We'll stick with the workaround for now, until/unless this becomes higher priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant
Projects
None yet
Development

No branches or pull requests

2 participants