Use closures for Svg::style

This commit is contained in:
Héctor Ramón Jiménez 2024-03-12 13:41:14 +01:00
parent 66dce4865e
commit 71b9b3c3b1
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 31 additions and 25 deletions

View file

@ -41,12 +41,12 @@ impl Sandbox for Tiger {
));
let svg = svg(handle).width(Length::Fill).height(Length::Fill).style(
if self.apply_color_filter {
|_theme, _status| svg::Appearance {
color: Some(color!(0x0000ff)),
}
} else {
|_theme, _status| svg::Appearance::default()
|_theme, _status| svg::Appearance {
color: if self.apply_color_filter {
Some(color!(0x0000ff))
} else {
None
},
},
);