Skip to content

Commit

Permalink
Merge pull request #1508 from rjwittams/web-svg-cond
Browse files Browse the repository at this point in the history
Change conditional use of svg to be on the feature svg instead of pla…
  • Loading branch information
richard-uk1 authored Jan 5, 2021
2 parents deeed08 + 4d34d78 commit 5991055
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions druid/examples/widget_gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use druid::{
AppLauncher, Color, Data, ImageBuf, Lens, Widget, WidgetExt, WidgetPod, WindowDesc,
};

#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "svg")]
use druid::widget::{Svg, SvgData};

const XI_IMAGE: &[u8] = include_bytes!("assets/xi.image");
Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn main() {
}

fn ui_builder() -> impl Widget<AppData> {
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "svg")]
let svg_example = label_widget(
Svg::new(
include_str!("./assets/tiger.svg")
Expand All @@ -77,8 +77,8 @@ fn ui_builder() -> impl Widget<AppData> {
"Svg",
);

#[cfg(target_arch = "wasm32")]
let svg_example = label_widget(Label::new("no SVG on wasm (yet)").center(), "Svg");
#[cfg(not(feature = "svg"))]
let svg_example = label_widget(Label::new("SVG not supported (yet)").center(), "Svg");

Scroll::new(
SquaresGrid::new()
Expand Down

0 comments on commit 5991055

Please sign in to comment.