Update changelog and version

This commit is contained in:
Piotr Siuszko 2025-01-24 12:34:35 +01:00
parent 2c9e8f45ba
commit 74245f1e20
3 changed files with 14 additions and 7 deletions

View File

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

View File

@ -1,6 +1,6 @@
[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"]

View File

@ -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: {}",