MattMcFarland / react-darkroom

An HTML5 Image Editing Component built with ReactJS
http://blog.mmcfarland.net/react-darkroom/
MIT License
124 stars 21 forks source link

Cropped image is stretched to the full canvas size #12

Open jakeorr opened 7 years ago

jakeorr commented 7 years ago

It should maintain it's aspect ratio with white borders the same way it does when you load an image.

MattMcFarland commented 7 years ago

Yes I believe I glossed past this issue a while back because I was not able to to successfully achieve this. This was quite a while ago, so maybe I could figure it out now since I have leveled up since I originally wrote this library.

The issue I ran into I believe (going from memory) was the ratio calculations. I seemed to have got stuck there, I dont know the details. I'll take a look and at least if I cant solve the issue, perhaps I'll raise it on stack overflow or ask for help once I can at least take a crack at it again and try to figure out what is wrong.