koorgoo / ngCropper

AngularJS wrapper for https://github.com/fengyuanchen/cropper
107 stars 72 forks source link

maximize:true does not work all image resolutions #38

Open Aakash-sanandiya opened 7 years ago

Aakash-sanandiya commented 7 years ago

Hello,

I have an issue setting cropper viewer to cover full height and width of the image being cropped when initializing it. I have used maximize:true param for this but this doesn't seem to work for all image resolutions. I am having a hard time figuring out why by looking at the source.

Image size it doesn't work for right now - 960x641

Below is my configuration for initializing cropper

vm.imageCropperOptions = {
            maximize: true,          
            done: function(dataNew) {
                imgCropData = dataNew;
            }
        };

ngCropper version - 0.2.2

I found that changing dragger.heightand dragger.width to 1 from 0.8 in initDragger() function does the job. Is this the correct solution ?