afonsolage / bevy_ecss

Bevy crate which uses a subset of CSS to update Bevy ECS components
Apache License 2.0
98 stars 11 forks source link

Add support for `ImageScaleMode` #63

Open Xenira opened 4 months ago

Xenira commented 4 months ago

I would like to add ImageScaleMode.

My proposal would be to use image-rendering css property for this. While it is not an exact match it is the closest I could find. Would look something like

image-rendering: sliced stretch 28

Got a basic impl done, but still needs some cleanup.

afonsolage commented 4 months ago

It wont be possible to keep a css match for bevy UI, since bevy UI itself doesn't have this goal.While there are some overlap, I think would be better to use bevy dialect, something like:

image-scale-mode: sliced | tiled
Xenira commented 4 months ago

I like the idea of using something bevy specific. Maybe use a vendor prefix as well, to clarify, that its bevy:

-bevy-image-scale-mode: sliced <stretch | tile int>...| tiled bool bool number
afonsolage commented 4 months ago

While this is a good idea, -bevy will be the default, so this can become annoying to add this prefix on every property, IMO. This can be useful if/when we have some conflict, like there is a valid css property with this name and another bevy component with the same name.