aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-12 03:47:37 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-12 03:47:37 +0200
commitb83e18c475fa68806accf5d5b23aafcc2234e5dc (patch)
treeb4f659c3fa895aa3a579ed4dbf22f9d31558361a /src/Body.cpp
parent1d44ae1b038b6d541bc45d298ba704f8a3fbd559 (diff)
Better drop shadow
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 76ad110..b3ec7e1 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -1486,13 +1486,14 @@ namespace QuickMedia {
}
float Body::get_item_height(BodyItem *item, float width, bool load_texture, bool include_embedded_item, bool merge_with_previous, int item_index) {
+ const bool rendering_card_view = card_view && card_view_enabled;
sf::Vector2i content_size = get_item_thumbnail_size(item);
float image_height = 0.0f;
float text_offset_x = body_spacing[body_theme].padding_x;
if(draw_thumbnails && load_texture && !item->thumbnail_url.empty() && !merge_with_previous) {
std::shared_ptr<ThumbnailData> item_thumbnail = AsyncImageLoader::get_instance().get_thumbnail(item->thumbnail_url, item->thumbnail_is_local, content_size);
- content_size = clamp_to_size_x(content_size, sf::Vector2i(width - body_spacing[body_theme].image_padding_x * 2.0f, content_size.y));
+ content_size = clamp_to_size_x(content_size, sf::Vector2i(width - (rendering_card_view ? 0.0f : body_spacing[body_theme].image_padding_x * 2.0f), content_size.y));
image_height = content_size.y;
if(item_thumbnail && item_thumbnail->loading_state == LoadingState::FINISHED_LOADING && item_thumbnail->image->getSize().x > 0 && item_thumbnail->image->getSize().y > 0) {
@@ -1526,7 +1527,7 @@ namespace QuickMedia {
// image_height = content_size.y;
}
- const float text_max_width = (card_view && card_view_enabled) ? width : (width - text_offset_x - body_spacing[body_theme].image_padding_x);
+ const float text_max_width = rendering_card_view ? width : (width - text_offset_x - body_spacing[body_theme].image_padding_x);
if(load_texture)
update_dirty_state(item, text_max_width);
@@ -1578,7 +1579,7 @@ namespace QuickMedia {
else
item_height = item->loaded_content_height;
- if(card_view && card_view_enabled) {
+ if(rendering_card_view) {
item_height += item->loaded_image_height;
} else {
const bool has_thumbnail = draw_thumbnails && !item->thumbnail_url.empty() && !merge_with_previous;