aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-13 11:33:29 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-13 11:33:29 +0200
commit0b86bc6849be72f28dedc15e726015d81d787cdf (patch)
tree525d23c9a2bd9017d2d1ac892968e0bcd581fba2
parent6f1a252490e7c74f577470616fc5fcaf79716c60 (diff)
Revert body item snap to bottom behavior when resizing window
-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) {