diff options
Diffstat (limited to 'src/Body.cpp')
-rw-r--r-- | src/Body.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 8cc139c..3e05a78 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -469,6 +469,7 @@ namespace QuickMedia { } mouse_left_clicked = false; + clicked_body_item = nullptr; return; } @@ -647,14 +648,6 @@ namespace QuickMedia { window.setView(prev_view); - mouse_left_clicked = false; - if(clicked_body_item) { - auto clicked_body_item_tmp = clicked_body_item; // tmp because below call to body_item_select_callback may call this same draw function - clicked_body_item = nullptr; - if(body_item_select_callback) - body_item_select_callback(clicked_body_item_tmp.get()); - } - 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) { @@ -685,6 +678,14 @@ namespace QuickMedia { else page_scroll -= item_target_bottom_diff*page_scroll_speed; } + + mouse_left_clicked = false; + if(clicked_body_item) { + auto clicked_body_item_tmp = clicked_body_item; // tmp because below call to body_item_select_callback may call this same draw function + clicked_body_item = nullptr; + if(body_item_select_callback) + body_item_select_callback(clicked_body_item_tmp.get()); + } } void Body::update_dirty_state(BodyItem *body_item, float width) { @@ -1052,6 +1053,8 @@ namespace QuickMedia { } } else if(item->thumbnail_size.x > 0) { text_offset_x += image_padding_x + content_size.x; + if(!merge_with_previous) + image_height = content_size.y; } if(load_texture) |