Image move when zooming
Opened this issue · 1 comments
pixelreseller commented
When i use range input to scale image, the anchor is in the left-top, and all moves (including rotate) are made from this anchor, not centered following cropper preview.
What am i missing?
$('#image-cropper').cropit({
freeMove: true,
initialZoom: 'image',
maxZoom: '2',
minZoom: 'fit',
smallImage: 'allow',
width: '320',
height: '320',
onImageLoaded: function(e) {
imageSize = $('#image-cropper').cropit('imageSize');
$('#image-cropper').cropit('offset', { x: 0, y: 0 });
$(".cropit-preview-image-container").css("height", $("html").outerWidth());
$('#image-cropper').cropit('previewSize', { width: imageSize.width, height: imageSize.width });
}
});
#lvb-image-cropper { width: 320px; } // container
#image-cropper { width: 100%; height: 100%; background-color: white }
pixelreseller commented
If i remove ".cropit('offset', { x: 0, y: 0 });", all move are ok, but my image is initialized out of preview area. I have to zoom out, move image in center of preview, and then i can modify it.