blueswen / mkdocs-glightbox

A MkDocs plugin supports image lightbox (zoom effect) with GLightbox.
https://blueswen.github.io/mkdocs-glightbox/
MIT License
115 stars 14 forks source link

large image zoom is faulty since 0.3.0 #21

Closed lukaszgiez closed 2 months ago

lukaszgiez commented 1 year ago

Im using material for mkdocs version 9.1.11 with your plugin, and a large image (for example, 3071 x 1896; 150dpi; 32bit; png) doesn't work well with zoom. On clicking the zoom icon, the picture isn't enlarged. Instead it moves to the left. Sometimes it moves beyond the screen.

I tested with versions 0.2.1, 0.3.0 and the latest, and it only works as it should (zoom icon indeed blows up the image in the browser) in 0.2.1. Is there an extra configuration option to be set which I am missing since 0.3.0 or is it a bug?

Tested in firefox and chrome.

blueswen commented 1 year ago

Could you provide your mkdocs.yaml or reproducible repository?

OokamiTheLord commented 6 months ago

Hi, this issue can be reproduced on this repository. On version 0.2.1 indeed everything works correctly, but on the latest after zooming most of the time image disappears.

What might help with investigation - if I try moving image before zooming, I usually can zoom correctly

killergoalie commented 6 months ago

Can confirm, it looks like when you zoom it doesn't zoom to the point of the image you click but instead shifts the image left off screen. With version 0.2.1 it will zoom but force to the right edge, shifting the image to the left. Version 0.1.0, 0.2.0, 0.3.0, and 0.3.1, all seem to send the image off the screen to the left. If I maximize my browser on my ultrawide monitor I can't see the zoomed image but when i click on the screen I can see the un-zoom effect of the image becoming smaller and coming from off screen from the left.

My doc is using a large resolution png file, roughly 10000x5400

blueswen commented 6 months ago

Thanks for reporting this bug and providing a reproducible repository. This bug has been fixed in v0.3.6 by changing the default width from 100% to auto, because 100% width will cause zooming offset incorrectly.