markerjs icon indicating copy to clipboard operation
markerjs copied to clipboard

Annotations jump slightly when rasterized

Open TheTechromancer opened this issue 5 years ago • 3 comments

First of all, thank you very much for taking the time to make marker.js. It is amazing :)

We are running into this issue when rendering marker.js inside a bootstrap modal. Any help/recommendations would be appreciated.

Peek 2020-10-06 10-03

Thanks!

TheTechromancer avatar Oct 06 '20 14:10 TheTechromancer

Not sure if this could be helpful but have you tried setting a different targetRoot in the config?

targetRoot - in case your target image is not a child of document.body you can specify a different root here,

ailon avatar Oct 07 '20 05:10 ailon

Thanks, I'll give this a try.

TheTechromancer avatar Oct 09 '20 19:10 TheTechromancer

Okay so I finally was able to test this, and I wasn't able to get targetRoot to influence the positioning.

However, the size of the image seems to be a factor. Small images (e.g. 200x100 pixels) are unaffected by the bug and render normally, whereas for larger ones, the div element containing the svg overlay (the one with absolute positioning) is placed slightly too far to the left. It seems like larger images result in larger offsets, but I could be extrapolating.

small-offset

TheTechromancer avatar Oct 26 '20 17:10 TheTechromancer