From 2c06a032fb2a5d7279cf8e92c3bb3e5ae9efb223 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 30 Apr 2025 17:35:11 +0800 Subject: [PATCH] svg_img: Fix SvgImg first load can work. (#828) --- crates/ui/src/svg_img.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/svg_img.rs b/crates/ui/src/svg_img.rs index b580f56a..404b04c9 100644 --- a/crates/ui/src/svg_img.rs +++ b/crates/ui/src/svg_img.rs @@ -265,7 +265,17 @@ impl Element for SvgImg { }), ) } - None => ((layout_id, None), None), + None => { + let task = load_svg(source, window, cx); + ( + (layout_id, None), + Some(SvgImgState { + hash: source_hash, + image: None, + task, + }), + ) + } } }) }