anselmh / object-fit

Polyfill (mostly IE) for CSS object-fit property to fill-in/fit-in images into containers.
MIT License
996 stars 92 forks source link

img-circle #11

Closed adaskalopoulos closed 10 years ago

adaskalopoulos commented 10 years ago

hi, i have been trying to make this work on a circle container, but unsuccessfully so far. I have tried to add the border radius 50% in my selector, but it gets ignored and when I use an extra class the object-fit does not work.

Any suggestions and help would be great . Thanks

anselmh commented 10 years ago

Yes, this is an issue indeed. I’m not sure how to solve this within the polyfill actually but I’ll look into an solution soon. If you find one, let me know or shoot me a Pull Request :)

anselmh commented 10 years ago

screen shot 2014-10-24 at 14 48 18

I had a look at it right now and found out that it does not ignore border-radius but applied it to the actual image size (which is bigger than the shown element as it needs to fit-in the image into the container. Therefore it looks weird and not as expected. Unfortunately I’m not able to fix this in the polyfill without bloating it up further (I could imagine we could re-write border-radius on image to something like css clip-path which is also widely unsupported).

Therefore I’m closing this issue except if you know a feasible way to solve this.