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:
parent
55f4c8e51b
commit
b38e3f16ad
3 changed files with 87 additions and 31 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue