Skip to content

Commit

Permalink
Update to 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Leinnan committed Jul 21, 2024
1 parent 7f34a72 commit 97201b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_simple_scroll_view"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
exclude = [".github/","wasm/", "record.gif"]
categories = ["game-development", "gui"]
Expand All @@ -11,10 +11,10 @@ license = "MIT OR Apache-2.0"
description = "Simple to use plugin implementing ScrollView into Bevy engine."

[dependencies.bevy]
version = "0.13"
version = "0.14"
default-features = false
features = ["bevy_ui", "bevy_asset", "bevy_text"]

[dev-dependencies.bevy]
version = "0.13"
version = "0.14"
default-features = true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Please keep PRs small and scoped to a single feature or fix.

Bevy version | crate version
--- | ---
0.14 | 0.2
0.13 | 0.1
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ fn input_mouse_pressed_move(
if let Ok(item) = content_q.get_mut(child) {
let mut scroll = item.0;
let max_scroll = (item.1.size().y - container_height).max(0.0);
info!("CONTAINER {}, max_scroll: {}",container_height,max_scroll);
scroll.pos_y += evt.delta.y;
scroll.pos_y = scroll.pos_y.clamp(-max_scroll, 0.);
}
Expand Down Expand Up @@ -115,6 +116,7 @@ fn input_touch_pressed_move(
if let Ok(item) = content_q.get_mut(child) {
let mut scroll = item.0;
let max_scroll = (item.1.size().y - container_height).max(0.0);
info!("CONTAINER {}, max_scroll: {}",container_height,max_scroll);
scroll.pos_y += touch.delta().y;
scroll.pos_y = scroll.pos_y.clamp(-max_scroll, 0.);
}
Expand Down

0 comments on commit 97201b9

Please sign in to comment.