Update to 0.14

This commit is contained in:
Piotr Siuszko 2024-07-21 13:35:18 +02:00
parent 7f34a72304
commit 97201b99cc
3 changed files with 6 additions and 3 deletions

View File

@ -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"]
@ -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

View File

@ -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

View File

@ -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.);
}
@ -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.);
}