diff --git a/.gitignore b/.gitignore index ea8c4bf..4fffb2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/Cargo.lock diff --git a/src/lib.rs b/src/lib.rs index edb42ed..b453242 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,8 +21,18 @@ impl Plugin for ScrollViewPlugin { #[derive(Component, Default, Debug, Reflect)] pub struct ScrollView; -#[derive(Component, Default, Debug, Reflect)] -pub struct ScrollViewport; +#[derive(Component, Debug, Reflect)] +pub struct ScrollViewport { + pub scroll_speed: f32, +} + +impl Default for ScrollViewport { + fn default() -> Self { + Self { + scroll_speed: 500.0, + } + } +} #[derive(Component, Debug, Reflect)] pub struct ScrollViewContent(pub Entity); @@ -38,7 +48,7 @@ pub fn create_scroll_view(mut commands: Commands, q: Query, - mut q: Query<(Entity, &mut Style, &Interaction), With>, + mut q: Query<(&mut Style, &Interaction, &ScrollViewport), With>, + time: Res