From 3cabd4bf6439e5b4cce78c956d5cfe868e3b412e Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Fri, 28 Jun 2024 15:58:19 +0200 Subject: [PATCH] gpui example: Fix SVG not showing up when running from root (#13648) Took me a while to figure out that I can't run cargo run -p gpui --example animation and that it has to run in the `gpui` crate. So I thought I'd fix this. Release Notes: - N/A --- crates/gpui/examples/animation.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/gpui/examples/animation.rs b/crates/gpui/examples/animation.rs index 7d7b875f2b..70bedb53c0 100644 --- a/crates/gpui/examples/animation.rs +++ b/crates/gpui/examples/animation.rs @@ -23,6 +23,11 @@ impl AssetSource for Assets { } } +const ARROW_CIRCLE_SVG: &'static str = concat!( + env!("CARGO_MANIFEST_DIR"), + "/examples/image/arrow_circle.svg" +); + struct AnimationExample {} impl Render for AnimationExample { @@ -42,7 +47,7 @@ impl Render for AnimationExample { .child( svg() .size_8() - .path("examples/image/arrow_circle.svg") + .path(ARROW_CIRCLE_SVG) .text_color(black()) .with_animation( "image_circle",