-
-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for object-fit css property #669
Comments
Hello, It's not supported yet, but it looks pretty easy to handle (in |
Very tempting. |
Not quite so simple (at least for me). I think I at least have the css parsing working. There must be some other code path than |
Yes, it's in |
I think I have |
Thanks a lot! 🎈 🎉
No, it's not. I can do it if you don't want to! |
I'm going to try and continue tomorrow, but if you want to give feedback I'd appreciate it. I think the layout code that is still missing the use of object-position is better to move out of |
I have a file that I'm testing with and manually comparing to what browsers render. What would the appropriate approach be to write tests for this? |
Your PR is simple and clean, I really appreciate it. Thank you. The major thing I'd change is to put
Yes, it's probably better in
You can rely on what's drawn, as it's done in |
I actually started out doing that, but I ran into circular imports when changing the various modules that had their own percentage functions. I think the main culprit is
I created PR #876 to maybe help with that. |
My test case now appears to work. In the pair of images the top are using The only ones that appear different are the ones to test I think the only thing left are tests (and the |
OK, I'll check that.
Nice! 😄
No problem.
Thank you very much. I'll merge your pull request, add tests and clean a couple of things. Thanks too for |
It works perfectly!
Could you please provide your example? I'd like to fix this bug too 😄. |
Here you go: https://codepen.io/mbarkhau/pen/NVoPBe |
For now, we only avoid the repetition when we have no-repeat for x and y axes. We could do this when the painting area is smaller than the image and when the position doesn't require a repetition. But… Who cares? Fix #238. There was also a bug in the size of the surface needed to draw images that are not repeated. Before this commit, the repeat size was the painting size * 2 to avoid glitches at the boundaries. But we have to be sure to draw at least the whole image, as the image may be translated before being drawn. The multiplication is not needed as we don't repeat the image anymore. Related to #669.
Thank you, it's now fixed. |
Hi:
I'm using WeasyPrint for generate PDF and the css property object-fit is not supported yet.
Do you have a plan to support this feature as this is really common used in my project.
Thanks.
The text was updated successfully, but these errors were encountered: