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
Another nice config option would be a preventOverZoom (true/false) flag. Currently it is possible to zoom beyond the bounds of the full size image's resolution, thus creating distortion.
It appears within the xscale method... you could check the natural dimensions of the image and prevent zooming beyond those bounds.
jQuery.fn.extend({
//IE 11 and below safe way to get the natural dimensions
getNaturalDimensions: function () {
if (this.length === 0) {
return null;
}
var img = this[0];
//Modern browsers
if ('naturalWidth' in img) {
return { width: img.naturalWidth, height: img.naturalHeight };
}
//Older browsers
var tempImg = new Image();
tempImg.src = img.src;
return { width: tempImg.width, height: tempImg.height };
}
});
The text was updated successfully, but these errors were encountered:
Another nice config option would be a preventOverZoom (true/false) flag. Currently it is possible to zoom beyond the bounds of the full size image's resolution, thus creating distortion.
It appears within the xscale method... you could check the natural dimensions of the image and prevent zooming beyond those bounds.
The text was updated successfully, but these errors were encountered: