Update changelog and version
This commit is contained in:
parent
2c9e8f45ba
commit
74245f1e20
|
|
@ -1,5 +1,11 @@
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## [0.3.1]
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Size calculation missmatch [#3](https://github.com/Leinnan/bevy_simple_scroll_view/issues/3)
|
||||||
|
|
||||||
## [0.3.0]
|
## [0.3.0]
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bevy_simple_scroll_view"
|
name = "bevy_simple_scroll_view"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
exclude = [".github/","wasm/", "record.gif"]
|
exclude = [".github/", "wasm/", "record.gif"]
|
||||||
categories = ["game-development", "gui"]
|
categories = ["game-development", "gui"]
|
||||||
keywords = ["bevy","ui"]
|
keywords = ["bevy", "ui"]
|
||||||
repository = "https://github.com/Leinnan/bevy_simple_scroll_view"
|
repository = "https://github.com/Leinnan/bevy_simple_scroll_view"
|
||||||
homepage = "https://github.com/Leinnan/bevy_simple_scroll_view"
|
homepage = "https://github.com/Leinnan/bevy_simple_scroll_view"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
@ -21,4 +21,4 @@ default-features = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
extra_logs = []
|
extra_logs = []
|
||||||
|
|
|
||||||
|
|
@ -127,14 +127,15 @@ fn update_size(
|
||||||
mut q: Query<(&Children, &ComputedNode), With<ScrollView>>,
|
mut q: Query<(&Children, &ComputedNode), With<ScrollView>>,
|
||||||
mut content_q: Query<(&mut ScrollableContent, &ComputedNode), Changed<ComputedNode>>,
|
mut content_q: Query<(&mut ScrollableContent, &ComputedNode), Changed<ComputedNode>>,
|
||||||
) {
|
) {
|
||||||
for (children, node) in q.iter_mut() {
|
for (children, scroll_view_node) in q.iter_mut() {
|
||||||
let container_height = node.size().y * node.inverse_scale_factor();
|
let container_height = scroll_view_node.size().y * scroll_view_node.inverse_scale_factor();
|
||||||
for &child in children.iter() {
|
for &child in children.iter() {
|
||||||
let Ok((mut scroll, node)) = content_q.get_mut(child) else {
|
let Ok((mut scroll, node)) = content_q.get_mut(child) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
scroll.max_scroll = (node.size().y * node.inverse_scale_factor()- container_height).max(0.0);
|
scroll.max_scroll =
|
||||||
|
(node.size().y * node.inverse_scale_factor() - container_height).max(0.0);
|
||||||
#[cfg(feature = "extra_logs")]
|
#[cfg(feature = "extra_logs")]
|
||||||
info!(
|
info!(
|
||||||
"CONTAINER {}, max_scroll: {}",
|
"CONTAINER {}, max_scroll: {}",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue