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

@ -550,7 +550,7 @@ fn fs_poly_sprite(input: PolySpriteVarying) -> @location(0) vec4<f32> {
}
let sprite = b_poly_sprites[input.sprite_id];
let distance = quad_sdf(input.position.xy, sprite.bounds, sprite.corner_radii);
let distance = quad_sdf(input.position.xy, sprite.content_mask, sprite.corner_radii);
var color = sample;
if ((sprite.grayscale & 0xFFu) != 0u) {