Consider padding when calculating container_height
This commit is contained in:
parent
17d4cfb263
commit
4f7b56467a
|
|
@ -155,7 +155,10 @@ fn update_size(
|
||||||
mut content_q: Query<(&mut ScrollableContent, &ComputedNode), Changed<ComputedNode>>,
|
mut content_q: Query<(&mut ScrollableContent, &ComputedNode), Changed<ComputedNode>>,
|
||||||
) {
|
) {
|
||||||
for (children, scroll_view_node) in q.iter_mut() {
|
for (children, scroll_view_node) in q.iter_mut() {
|
||||||
let container_height = scroll_view_node.size().y * scroll_view_node.inverse_scale_factor();
|
let container_height = (scroll_view_node.size().y
|
||||||
|
- scroll_view_node.padding.top
|
||||||
|
- scroll_view_node.padding.bottom)
|
||||||
|
* 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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue