gpui: img element object-fit (#9393)

Release Notes:

- Added [object-fit
API](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) to the
`img` element. This allows the user to decide how the image is scaled
within the element bounds.
- Fixes corner radius not working as expected on overflowing elements.
This commit is contained in:
Matthias Grandl 2024-03-15 18:06:07 +01:00 committed by GitHub
parent 55f4c8e51b
commit b38e3f16ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 87 additions and 31 deletions

View file

@ -372,7 +372,7 @@ fragment float4 polychrome_sprite_fragment(
float4 sample =
atlas_texture.sample(atlas_texture_sampler, input.tile_position);
float distance =
quad_sdf(input.position.xy, sprite.bounds, sprite.corner_radii);
quad_sdf(input.position.xy, sprite.content_mask.bounds, sprite.corner_radii);
float4 color = sample;
if (sprite.grayscale) {