[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-981-gee631db42
paul at claws-mail.org
paul at claws-mail.org
Mon Aug 17 11:48:28 CEST 2020
The branch, gtk3 has been updated
via ee631db42de5a198fbb0516fae6ba51a08843747 (commit)
from 3ba140dd7068c4388999a6b5ffdd76c76f89cd4f (commit)
Summary of changes:
src/gtk/gtkutils.c | 43 +++++++++++++++++--------------------------
1 file changed, 17 insertions(+), 26 deletions(-)
- Log -----------------------------------------------------------------
commit ee631db42de5a198fbb0516fae6ba51a08843747
Author: Paul <paul at claws-mail.org>
Date: Mon Aug 17 10:47:25 2020 +0100
improve image display, particularly for large images, especially if taller than they are wide
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index b6109be01..4f0544560 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1777,32 +1777,6 @@ GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, int box_width,
}
}
- w = gdk_pixbuf_get_width(pixbuf);
- h = gdk_pixbuf_get_height(pixbuf);
-
- if (angle == 90 || angle == 270) {
- avail_height = box_width;
- avail_width = box_height;
- } else {
- avail_width = box_width;
- avail_height = box_height;
- }
-
- /* Scale first */
- if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
- if (w > avail_width) {
- h = (avail_width * h) / w;
- w = avail_width;
- }
- if (h > avail_height) {
- w = (avail_height * w) / h;
- h = avail_height;
- }
- t_pixbuf = gdk_pixbuf_scale_simple(pixbuf,
- w, h, GDK_INTERP_BILINEAR);
- g_object_unref(pixbuf);
- pixbuf = t_pixbuf;
- }
/* Rotate if needed */
if (angle != 0) {
@@ -1825,6 +1799,23 @@ GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, int box_width,
pixbuf = t_pixbuf;
}
+ w = gdk_pixbuf_get_width(pixbuf);
+ h = gdk_pixbuf_get_height(pixbuf);
+
+ avail_width = box_width;
+ avail_height = box_height;
+
+ if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
+ if (w > avail_width || h > avail_height) {
+ h = (avail_width * h) / w;
+ w = avail_width;
+ }
+ t_pixbuf = gdk_pixbuf_scale_simple(pixbuf,
+ w, h, GDK_INTERP_BILINEAR);
+ g_object_unref(pixbuf);
+ pixbuf = t_pixbuf;
+ }
+
return pixbuf;
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list