Skip to content

Commit

Permalink
Update changelog and version
Browse files Browse the repository at this point in the history
  • Loading branch information
Leinnan committed Jan 24, 2025
1 parent 2c9e8f4 commit 74245f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [0.3.1]

## Fixed

- Size calculation missmatch [#3](https://github.com/Leinnan/bevy_simple_scroll_view/issues/3)

## [0.3.0]

## Added
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "bevy_simple_scroll_view"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
exclude = [".github/","wasm/", "record.gif"]
exclude = [".github/", "wasm/", "record.gif"]
categories = ["game-development", "gui"]
keywords = ["bevy","ui"]
keywords = ["bevy", "ui"]
repository = "https://github.com/Leinnan/bevy_simple_scroll_view"
homepage = "https://github.com/Leinnan/bevy_simple_scroll_view"
license = "MIT OR Apache-2.0"
Expand All @@ -21,4 +21,4 @@ default-features = true

[features]
default = []
extra_logs = []
extra_logs = []
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ fn update_size(
mut q: Query<(&Children, &ComputedNode), With<ScrollView>>,
mut content_q: Query<(&mut ScrollableContent, &ComputedNode), Changed<ComputedNode>>,
) {
for (children, node) in q.iter_mut() {
let container_height = node.size().y * node.inverse_scale_factor();
for (children, scroll_view_node) in q.iter_mut() {
let container_height = scroll_view_node.size().y * scroll_view_node.inverse_scale_factor();
for &child in children.iter() {
let Ok((mut scroll, node)) = content_q.get_mut(child) else {
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")]
info!(
"CONTAINER {}, max_scroll: {}",
Expand Down

0 comments on commit 74245f1

Please sign in to comment.