Open daveshapiro opened 9 years ago
Hi, currently, the zoom always from center as use for only avatar crop. If you want to use with large image, you can replace setBackground function with the following:
setBackground = function()
{
var w = parseInt(obj.image.width)*obj.ratio;
var h = parseInt(obj.image.height)*obj.ratio;
//var pw = (el.width() - w) / 2;
//var ph = (el.height() - h) / 2;
el.css({
'background-image': 'url(' + obj.image.src + ')',
'background-size': w +'px ' + h + 'px',
//'background-position': pw + 'px ' + ph + 'px',
'background-position': 'px ' + 'px',
'background-repeat': 'no-repeat'});
},
I will add an option for zoom function as params later.
Cheers,
That's still no good... The provided alternative will expand/shrink from the top-left. Expected behavior is:
Actually, the logic is simple. You can customize background position as you expected. I will update the plugin soon when I have free time, Cheers
On Fri, Nov 7, 2014 at 9:20 PM, daveshapiro notifications@github.com wrote:
That's still no good... The provided alternative will expand/shrink from the top-left. Expected behavior is:
- When zooming using mouse, use mouse cursor as center point
- When zooming using +/- buttons, use center of stage as center point
— Reply to this email directly or view it on GitHub https://github.com/hongkhanh/cropbox/issues/5#issuecomment-62150448.
Desperately need this feature as well. Any update on when it should be expected?
+1
Move an image away from origin and then attempt to zoom. The image snaps back to origin.