svg_img: Fix SvgImg first load can work. (#828)

This commit is contained in:
Jason Lee 2025-04-30 17:35:11 +08:00 committed by GitHub
parent 38d9c24af5
commit 2c06a032fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
}),
)
}
}
})
}