summaryrefslogtreecommitdiff
path: root/plugins/gtkui/plcommon.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-17 21:56:51 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-17 21:56:51 +0200
commit731a83297863f19bb688da56892f83c528a7b65b (patch)
treeb21b66b8992b5dddbbe28260c21fd49b51560c34 /plugins/gtkui/plcommon.c
parent941477720d3ef7677d40a9e0eb87f80f0eaabb96 (diff)
gtkui: portrait-oriented cover drawing fix
Diffstat (limited to 'plugins/gtkui/plcommon.c')
-rw-r--r--plugins/gtkui/plcommon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c
index 46d06aaa..ea634519 100644
--- a/plugins/gtkui/plcommon.c
+++ b/plugins/gtkui/plcommon.c
@@ -226,15 +226,23 @@ void draw_column_data (DdbListview *listview, cairo_t *cr, DdbListviewIter it, D
int h = cwidth - group_y;
h = min (height, art_h);
+ int hq = 0;
GdkPixbuf *pixbuf = get_cover_art_callb (deadbeef->pl_find_meta (((DB_playItem_t *)group_it), ":URI"), artist, album, real_art_width == art_width ? art_width : -1, redraw_playlist_single, listview);
if (!pixbuf) {
pixbuf = cover_get_default_pixbuf ();
+ if (!listview->cover_refresh_timeout_id) {
+ hq = 1;
+ }
}
if (pixbuf) {
art_width = gdk_pixbuf_get_width (pixbuf);
float art_scale = (float)real_art_width / art_width;
int pw = real_art_width;
int ph;
+ if (gdk_pixbuf_get_width (pixbuf) < gdk_pixbuf_get_height (pixbuf)) {
+ art_scale *= (float)gdk_pixbuf_get_width (pixbuf) / gdk_pixbuf_get_height (pixbuf);
+ }
+
if (group_pinned == 1 && gtkui_groups_pinned) {
ph = group_height;
}
@@ -264,7 +272,7 @@ void draw_column_data (DdbListview *listview, cairo_t *cr, DdbListviewIter it, D
}
cairo_scale (cr, art_scale, art_scale);
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
- cairo_pattern_set_filter (cairo_get_source(cr), art_width == real_art_width ? CAIRO_FILTER_GAUSSIAN : CAIRO_FILTER_FAST);
+ cairo_pattern_set_filter (cairo_get_source(cr), (hq || art_width == real_art_width) ? CAIRO_FILTER_GAUSSIAN : CAIRO_FILTER_FAST);
cairo_fill (cr);
cairo_restore (cr);
}