zed/crates/gpui/examples
Jason Lee 938a0679c0
gpui: Fix img element to auto size when only have width or height (#17994)
Release Notes:

- N/A

---

We may only want to set the height of an image to limit the size and
make the width adaptive.

In HTML, we will only set width or height, and the other side will adapt
and maintain the original image ratio.

I changed this because I had a logo image that only to be limited in
height, and then I found that setting the height of the `img` alone
would not display correctly.

I also tried to set `ObjectFit` in this Demo, but it seems that none of
them can achieve the same effect as "After".

## Before
<img width="809" alt="before 2024-09-18 164029"
src="https://github.com/user-attachments/assets/7ba559ed-e53b-43e6-a072-93c8ba5b14ee">

## After
<img width="749" alt="after 2024-09-18 172003"
src="https://github.com/user-attachments/assets/51ee2eba-76b3-400a-abbf-de0e9c4021e2">
2024-09-30 16:39:19 -07:00
..
image gpui: Fix img element to auto size when only have width or height (#17994) 2024-09-30 16:39:19 -07:00
svg
animation.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
gif_viewer.rs
hello_world.rs
input.rs gpui: Allow TextInput example to lose and gain focus (#17823) 2024-09-14 15:49:53 -04:00
opacity.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
ownership_post.rs
set_menus.rs
shadow.rs
text_wrapper.rs gpui: Fix CJK line wrap for GPUI text render (#17737) 2024-09-12 15:55:03 -04:00
uniform_list.rs gpui: Add example for uniform_list (#17421) 2024-09-05 14:24:10 -04:00
window_positioning.rs
window_shadow.rs