vue-easy-lightbox icon indicating copy to clipboard operation
vue-easy-lightbox copied to clipboard

Feature Request - Options for scale ratio

Open Whitlyne opened this issue 2 years ago • 4 comments

Hi ,

Could you add an access to the scale ratio of the zoom as a props ?

Thanks in advance

Whitlyne avatar Aug 10 '22 12:08 Whitlyne

Hi,

The scaling is non-linear. You may want to check here.

I'm not sure what you want is to control the scale of the current image, or the scale ratio each time you click the zoom button.

I have no idea how to implement it right now, so I'd like to learn if there is a similar solution.

XiongAmao avatar Aug 12 '22 03:08 XiongAmao

Hello, I've managed to extract the defaultScale const from here https://github.com/XiongAmao/vue-easy-lightbox/blob/edad9c4af90e03ce035806694b3679f3d45d52bb/src/vue-easy-lightbox.tsx#L250 into a prop and that seems to work well enough, I've submitted a PR: https://github.com/XiongAmao/vue-easy-lightbox/pull/103

grunghi avatar Aug 12 '22 07:08 grunghi

Hi, @Whitlyne #103 Props zoomScale and maxZoom have been released in v1.8.0.
You can try it and see if it works for your needs.

XiongAmao avatar Aug 12 '22 09:08 XiongAmao

@grunghi Thank you so much!

XiongAmao avatar Aug 12 '22 09:08 XiongAmao

Hello, I'm not sure if the functionality is already integrated into the component and I'm just not seeing it, but is there any way to have 2 max zoom props? One would be maxZoomIn which functions like the current maxZoom prop, and the other would be maxZoomOut which would prevent the image from being scaled really small. Nice work by the way!

DanWebster31 avatar Nov 03 '22 23:11 DanWebster31

@DanWebster31 Hi, i added minZoom in v1.10.0. I hope this will help.

XiongAmao avatar Nov 04 '22 04:11 XiongAmao

Perfect, thanks!

DanWebster31 avatar Nov 04 '22 16:11 DanWebster31