matheusdavidson / angular-cropperjs

CropperJS integration for Angular +6
MIT License
109 stars 69 forks source link

How to Setup Max Width and Max Height? #19

Closed SvenBudak closed 6 years ago

SvenBudak commented 6 years ago

I tryed alot but i cant find a way to setup a max-width and a max-height for the crop element. If i give the Wrapper Containers some limitation, the cropper still grow out if the box:. http://prntscr.com/kddy17

Any JavaScript setup inline heights and widths. Any Solution for this?

DanielEberl commented 6 years ago

I am trying to solve this aswell, not finding a solution yet. Have you found one already?

DanielEberl commented 6 years ago

import the following into the .scss / css file of your component or import it globally:

:host /deep/ angular-cropper .cropper { width: auto !important; height: auto !important; max-height: 400px !important; }

replace height with your desired value.

SvenBudak commented 6 years ago

This dont really solve my problem :( seems to be a js problem...

DanielEberl commented 6 years ago

Maybe your containers are the issue ? For me it’s working fine inside flexbox containers

matheusdavidson commented 6 years ago

Hi there, you need to set:

.cropper img {
    max-height: {YOUR-HEIGHT}px !important;
}