react-pdf-highlighter
react-pdf-highlighter copied to clipboard
Area Highlight is misaligned on container resize
When an area highlight is placed after window resize, the highlights are not aligned with the mouse pointer. Seems to be off by a scale factor.
https://github.com/agentcooper/react-pdf-highlighter/assets/23505065/0080dbc8-efca-4fd0-97a2-279ce77323a7
I've proposed a fix for this just now. You can wait for it to get merged or implement it yourself for the time being. You could also use my fork, but its structure and syntax is quite different to this repo and will probably be more effort to adapt to your application.
If you are facing the issue while zooming in or zooming out then you can divide your rect with scale value.
Make sure you have to save scale for different selection.
And pass this as prop to your highlighter component