Skip to content

Commit

Permalink
fix: feature flag errors
Browse files Browse the repository at this point in the history
  • Loading branch information
simbleau committed Jul 5, 2024
1 parent 57b48bc commit 01193c5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: cargo clippy -- -D warnings

- name: Build | Rustfmt
run: cargo fmt --all -- --check
run: cargo fmt -- --check

check:
runs-on: ubuntu-latest
Expand All @@ -43,7 +43,7 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Build | Check (native)
run: cargo check --all
run: cargo check

- name: Build | Check (wasm)
run: cargo check --target wasm32-unknown-unknown
Expand All @@ -70,7 +70,7 @@ jobs:
uses: Swatinem/[email protected]

- name: Build | Test (native)
run: cargo test --all
run: cargo test

- name: Build | Test (wasm)
run: wasm-pack test --node
3 changes: 1 addition & 2 deletions examples/scene_ui/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::f64::consts::{FRAC_PI_4, SQRT_2};

use bevy::{color::palettes::css, prelude::*};
use bevy_vello::{prelude::*, VelloPlugin};
use std::f64::consts::{FRAC_PI_4, SQRT_2};

fn main() {
App::new()
Expand Down
2 changes: 2 additions & 0 deletions src/integrations/dot_lottie/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ pub fn run_transitions(
}
}
PlayerTransition::OnComplete { state } => {
// can be irrefutable if only feature is lottie
#[allow(irrefutable_let_patterns)]
if let VectorFile::Lottie(composition) = &current_asset.file {
let loops_needed = match options.looping {
PlaybackLoopBehavior::DoNotLoop => Some(0),
Expand Down
13 changes: 9 additions & 4 deletions src/render/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ pub struct ExtractedRenderAsset {
pub alignment: VelloAssetAlignment,
pub transform: GlobalTransform,
pub z_function: ZFunction,
pub render_mode: CoordinateSpace,
pub ui_node: Option<Node>,
#[cfg(feature = "lottie")]
pub theme: Option<crate::Theme>,
pub render_mode: CoordinateSpace,
#[cfg(feature = "lottie")]
pub playhead: f64,
#[cfg(feature = "lottie")]
pub alpha: f32,
pub ui_node: Option<Node>,
}

#[cfg(feature = "svg")]
Expand Down Expand Up @@ -54,6 +56,7 @@ pub fn extract_svg_instances(
if let Some(
asset @ VelloAsset {
file: _file @ crate::VectorFile::Svg(_),
#[cfg(feature = "lottie")]
alpha,
..
},
Expand All @@ -65,12 +68,14 @@ pub fn extract_svg_instances(
transform: *transform,
alignment: *alignment,
z_function: *z_function,
render_mode: *coord_space,
ui_node: ui_node.cloned(),
#[cfg(feature = "lottie")]
theme: None,
render_mode: *coord_space,
#[cfg(feature = "lottie")]
playhead: 0.0,
#[cfg(feature = "lottie")]
alpha: *alpha,
ui_node: ui_node.cloned(),
});
}
}
Expand Down

0 comments on commit 01193c5

Please sign in to comment.