-
Notifications
You must be signed in to change notification settings - Fork 598
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
Add image-scaling property to Images to control how they are scaled #465
Conversation
Like CSS image-rendering it has "smooth" and "pixelated" options. Only OpenGL has been tested right now, have not tested WASM or Qt. Right now the first instance of a @image-url() will set the scaling for that specific image. The same image used from memory on the otherhand can all have a different scaling property.
Thanks for your contribution, this is very welcome. It looks good to me, I just have a few minor point:
Since the wasm backend is the same as the GL backend, i imagine it should work out of the box. Then, there is the question of naming. |
Yeah, I forgot to remove the example from Cargo.toml because the example was not really interesting. I don't have Qt so I hadn't implemented it, but if someone else can implement it that would help. I did get wasm to compile after working through a perl issue and it does work as expected. I chose |
I very much like the name as proposed in the latest patch set :-) (image-rendering). Nice addition! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Only thing is to fix CI because the test has an error, and one should do cargo fmt
This file is also available under commercial licensing terms. | ||
Please contact info@sixtyfps.io for more information. | ||
LICENSE END */ | ||
import { HorizontalLayout } from "sixtyfps_widgets.60"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { HorizontalLayout } from "sixtyfps_widgets.60"; |
Not needed because HorizontalLayout is a builtin element
Thank you! I'll do the Qt backend changes now |
I done the Qt backend. Btw, i noticed a bug: the image-rendering property is not properly applied if both image are the same file with the GL backend, because the cached texture contains the image-rendering flag, but it is not part of the cache key. |
…ge-rendering properties As tests/cases/examples/image_rendering.60 itself demonstrates, the png file should be loaded into the CPU side image cache once, but the two textures should be cached independently. cc #465
…ge-rendering properties As tests/cases/examples/image_rendering.60 itself demonstrates, the png file should be loaded into the CPU side image cache once, but the two textures should be cached independently. cc #465
Thanks for merging and adding Qt support. Yeah, which ever Image instance references a file first "locks in" the image-rendering setting for that image. I wasn't sure how to change the cache key. |
Like CSS image-rendering it has "smooth" and "pixelated" options. Only OpenGL has been tested right now, have not tested WASM or Qt. Right now the first instance of a
@image-url()
will set the scaling for that specific image. The same image used from memory on the otherhand can all have a different scaling property.Still need to update documentation, but I wanted to get other backends working, possibly fix the image-url issue, and ask if there is a better way to implement this first.