aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Body.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 1f339ce..09d3051 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -480,7 +480,9 @@ namespace QuickMedia {
const float start_y = pos.y;
body_pos = pos;
- body_size = size;
+ bool body_size_changed = std::abs(size.x - body_size.x) > 0.1f || std::abs(size.y - body_size.y) > 0.1f;
+ if(body_size_changed)
+ body_size = size;
elapsed_time_sec = draw_timer.getElapsedTime().asSeconds();
@@ -662,7 +664,8 @@ namespace QuickMedia {
if(attach_side == AttachSide::TOP) {
if(first_item_fully_visible) {
page_scroll -= offset_to_top;
- } else {
+ } else if(last_item_fully_visible && !first_item_fully_visible && body_size_changed) {
+ page_scroll += offset_to_bottom;
//page_scroll = get_offset_to_first_visible_item(size);
}
} else if(attach_side == AttachSide::BOTTOM) {