You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this mistake state, this is wrong (even in the demo):
While cursor is in the edge of the photo, the lens position has mistake - you can see the cursor position is not on the edge in the zoom, although it was on edge in the photo).
There are mistakes in both
zoomX
and inzoomY
.Current:
zoomX = -Math.floor(relX / $element.width() * (NATIVE_IMG.width * $options.scale) - $options.width / 2);
zoomY = -Math.floor(relY / $element.height() * (NATIVE_IMG.height * $options.scale) - $options.height / 2);
In this mistake state, this is wrong (even in the demo):
![image](https://user-images.githubusercontent.com/54359860/95454548-48ac3100-0975-11eb-8029-50d0a68f9951.png)
While cursor is in the edge of the photo, the lens position has mistake - you can see the cursor position is not on the edge in the zoom, although it was on edge in the photo).
The fix:
zoomX =-6 -Math.floor(relX / $element.width() * (NATIVE_IMG.width * $options.scale) - $options.width / 2);
zoomY =-6 -Math.floor(relY / $element.height() * (NATIVE_IMG.height * $options.scale) - $options.height / 2);
(Just added
-6
to each calculation)Don't really know why tho (LOL) but it works now for every image..
The text was updated successfully, but these errors were encountered: