fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

version upgrade 3.0.0-beta to 3.0.0-rc #879

Closed hasanmumin closed 7 years ago

hasanmumin commented 7 years ago

Hi, i try to version upgrade beta to rc, cropper is not stretch the parent. This only happens on android device.Width and height seem to be calculating incorrectly.

Version 3.0.0-beta

screen shot 2017-04-27 at 09 00 39

Version 3.0.0-rc

screen shot 2017-04-27 at 09 00 52
fengyuanchen commented 7 years ago

Just set the width of your image and image container to 100%:

.img-container {
  width: 100%;
}

.img-container > img {
  width: 100%;
}
hasanmumin commented 7 years ago

Nope, i already have this. it is the same, only android browser have this problem.

hasanmumin commented 7 years ago

html

<div class="col-xs-12 col-sm-12" style="position: relative;overflow: hidden;padding-top: 10px;">
      <img src="" class="" alt="" id="selected-image">
</div>

javascript

$image.attr('src', selectedImage);
 setTimeout(function(){
     $image.cropper({
                            rotatable: false,
                            cropBoxResizable: false,
                            aspectRatio: 16 / 9,
                            dragMode: "move",
                            viewMode: 2,            
                            autoCropArea: 1,
                            minCropBoxWidth:"2000",
                            minCropBoxHeight:"2000",
                        });
 $(window).trigger('resize');

}, 500);
hasanmumin commented 7 years ago

v3.0.0-rc.3 has the same problem. You closed the issue but problem problem still persistç

fengyuanchen commented 7 years ago

I have not idea on this, you might have to check your code carefully for the problem by yourself.