Text selection highlight misalignment during zoom operations

Which product are you using?
PDF.js Express Viewer v8.7.5

Detailed description of issue
When zooming in and out after selecting text in the document viewer, the highlight layer becomes misaligned with the underlying text. This issue can appear after just a few zoom actions or may require more extensive zooming to reproduce.

Steps to Reproduce

  1. Open the document in the public demo viewer.
  2. Select a portion of text.
  3. Use the zoom in/out functionality several times.
  4. Observe that the text selection highlight no longer aligns correctly with the text.

Expected Result
The selected text highlight should remain aligned with the text regardless of zoom level.

Actual Result
The highlight layer shifts position, causing the visible selection to move out of sync with the text.

Does your issue happen with every document, or just one?
Every document

Please investigate and advise on a fix to keep the selection layer aligned during zoom operations.

A screen recording is attached for reference.
Kapture 2025-03-21 at 09.03.57

Hi there,

I am unable to reproduce the issue as shown in your video, could you please try reproducing it in the plus viewer?

best regards,
Kevin

Its quite easy to reproduce in the free viewer (just zoom quickly in and out a couple of times with an active selection). I did not manage to reproduce in the plus version.

Thank you for reporting this, I will add this to the backlog for the product team to review.

Best regards,
Kevin