Update to 0.14
This commit is contained in:
parent
7f34a72304
commit
97201b99cc
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bevy_simple_scroll_view"
|
name = "bevy_simple_scroll_view"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
exclude = [".github/","wasm/", "record.gif"]
|
exclude = [".github/","wasm/", "record.gif"]
|
||||||
categories = ["game-development", "gui"]
|
categories = ["game-development", "gui"]
|
||||||
|
|
@ -11,10 +11,10 @@ license = "MIT OR Apache-2.0"
|
||||||
description = "Simple to use plugin implementing ScrollView into Bevy engine."
|
description = "Simple to use plugin implementing ScrollView into Bevy engine."
|
||||||
|
|
||||||
[dependencies.bevy]
|
[dependencies.bevy]
|
||||||
version = "0.13"
|
version = "0.14"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["bevy_ui", "bevy_asset", "bevy_text"]
|
features = ["bevy_ui", "bevy_asset", "bevy_text"]
|
||||||
|
|
||||||
[dev-dependencies.bevy]
|
[dev-dependencies.bevy]
|
||||||
version = "0.13"
|
version = "0.14"
|
||||||
default-features = true
|
default-features = true
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,5 @@ Please keep PRs small and scoped to a single feature or fix.
|
||||||
|
|
||||||
Bevy version | crate version
|
Bevy version | crate version
|
||||||
--- | ---
|
--- | ---
|
||||||
|
0.14 | 0.2
|
||||||
0.13 | 0.1
|
0.13 | 0.1
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ fn input_mouse_pressed_move(
|
||||||
if let Ok(item) = content_q.get_mut(child) {
|
if let Ok(item) = content_q.get_mut(child) {
|
||||||
let mut scroll = item.0;
|
let mut scroll = item.0;
|
||||||
let max_scroll = (item.1.size().y - container_height).max(0.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 += evt.delta.y;
|
||||||
scroll.pos_y = scroll.pos_y.clamp(-max_scroll, 0.);
|
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) {
|
if let Ok(item) = content_q.get_mut(child) {
|
||||||
let mut scroll = item.0;
|
let mut scroll = item.0;
|
||||||
let max_scroll = (item.1.size().y - container_height).max(0.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 += touch.delta().y;
|
||||||
scroll.pos_y = scroll.pos_y.clamp(-max_scroll, 0.);
|
scroll.pos_y = scroll.pos_y.clamp(-max_scroll, 0.);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue