aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Body.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 42a3b35..076d093 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -600,8 +600,6 @@ namespace QuickMedia {
if(pos.y + selected_scrolled > 0.0f)
selected_scrolled = 0.0f;
- else
- pos.y += selected_scrolled;
} else {
if(page_scroll < 0.0)
page_scroll = 0.0;
@@ -611,8 +609,6 @@ namespace QuickMedia {
if(pos.y + selected_scrolled < body_size.y)
selected_scrolled = 0.0f;
- else
- pos.y += selected_scrolled;
}
pos.y += selected_scrolled;
@@ -749,12 +745,12 @@ namespace QuickMedia {
if(is_touch_enabled())
return;
- const float item_target_top_diff = item_background_target_pos_y;
- const float item_target_bottom_diff = (item_background_target_pos_y + item_background_target_height + spacing_y) - body_size.y;
- if(((body_size_changed && attach_side == AttachSide::BOTTOM) || selected_item_diff < 0) && item_target_top_diff < 0.0f) {
+ const float item_target_top_diff = item_background_target_pos_y - selected_scrolled;
+ const float item_target_bottom_diff = (item_background_target_pos_y - selected_scrolled + item_background_target_height + spacing_y) - body_size.y;
+ if(item_target_top_diff < 0.0f || !selected_item_fits_in_body) {
//extra_scroll_target -= item_target_top_diff;
stuck_direction = StuckDirection::TOP;
- } else if(((body_size_changed && attach_side == AttachSide::TOP) || selected_item_diff > 0) && item_target_bottom_diff > 0.0) {
+ } else if(item_target_bottom_diff > 0.0) {
//extra_scroll_target -= item_target_bottom_diff;
stuck_direction = StuckDirection::BOTTOM;
}