summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-07-27 10:54:35 +0200
committerLuke from DC <[email protected]>2022-09-11 17:27:42 +0000
commit2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c (patch)
tree4c80b31a0872d1c4ab0081ed7d4828f6b3c1b3b9 /src
parent2e5d87ab81962f2e34f9106eadde6474b5826ff1 (diff)
downloadeom-2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c.tar.bz2
eom-2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c.tar.xz
eom-close-confirmation-dialog: fix -Wbad-function-cast warning
Diffstat (limited to 'src')
-rw-r--r--src/eom-close-confirmation-dialog.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/eom-close-confirmation-dialog.c b/src/eom-close-confirmation-dialog.c
index ad8dc63..b862ba0 100644
--- a/src/eom-close-confirmation-dialog.c
+++ b/src/eom-close-confirmation-dialog.c
@@ -451,8 +451,6 @@ populate_model (GtkTreeModel *store, GList *imgs)
const gchar *name;
GdkPixbuf *buf = NULL;
GdkPixbuf *buf_scaled = NULL;
- int width;
- double ratio;
img = EOM_IMAGE (imgs->data);
@@ -460,9 +458,17 @@ populate_model (GtkTreeModel *store, GList *imgs)
buf = eom_image_get_thumbnail (img);
if (buf) {
- ratio = IMAGE_COLUMN_HEIGHT / (double) gdk_pixbuf_get_height (buf);
- width = (int) (gdk_pixbuf_get_width (buf) * ratio);
- buf_scaled = gdk_pixbuf_scale_simple (buf, width, IMAGE_COLUMN_HEIGHT, GDK_INTERP_BILINEAR);
+ int height;
+ int width;
+ double ratio;
+
+ height = gdk_pixbuf_get_height (buf);
+ ratio = IMAGE_COLUMN_HEIGHT / (double) height;
+ width = gdk_pixbuf_get_width (buf);
+ buf_scaled = gdk_pixbuf_scale_simple (buf,
+ (int) (ratio * (double) width),
+ IMAGE_COLUMN_HEIGHT,
+ GDK_INTERP_BILINEAR);
} else
buf_scaled = get_nothumb_pixbuf ();