From 0b86bc6849be72f28dedc15e726015d81d787cdf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 13 May 2021 11:33:29 +0200 Subject: Revert body item snap to bottom behavior when resizing window --- src/Body.cpp | 7 +++++-- 1 file 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) { -- cgit v1.2.3