diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-04-28 08:00:26 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-04-28 08:00:26 +0000 |
commit | ed8225270aa79262e1c29519a62a7faede6c4dbe (patch) | |
tree | 9cca8f1b6f96c30b9d1e83fde08db80a42e3f825 | |
parent | 5c9d94e0a86d35a219daa154838327b2af119734 (diff) |
suppressed unrequired image scaling.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@233 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/imageview.c | 24 |
3 files changed, 24 insertions, 10 deletions
@@ -1,5 +1,10 @@ 2005-04-27 + * src/imageview.c: imageview_get_resized_pixbuf(): don't scale images + if not required (just increase ref count). + +2005-04-27 + * src/mainwindow.c: main_window_create(): disable no longer required workaround for resize grip on GTK+ 2.6. diff --git a/ChangeLog.ja b/ChangeLog.ja index 6981f6d6..1a91ee94 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-04-27 + * src/imageview.c: imageview_get_resized_pixbuf(): 必要ない場合画像を + スケールしないようにした(単に参照カウントを増加)。 + +2005-04-27 + * src/mainwindow.c: main_window_create(): GTK+ 2.6 では不要なリサイズ グリップのための対処を無効にした。 diff --git a/src/imageview.c b/src/imageview.c index 2f664dc8..bbe14c9e 100644 --- a/src/imageview.c +++ b/src/imageview.c @@ -33,7 +33,7 @@ #include "imageview.h" #include "utils.h" -static void get_resized_size (gint w, +static gboolean get_resized_size(gint w, gint h, gint aw, gint ah, @@ -169,17 +169,19 @@ GdkPixbuf *imageview_get_resized_pixbuf(GdkPixbuf *pixbuf, GtkWidget *parent, if (avail_width > margin) avail_width -= margin; if (avail_height > margin) avail_height -= margin; - get_resized_size(gdk_pixbuf_get_width(pixbuf), - gdk_pixbuf_get_height(pixbuf), - avail_width, avail_height, - &new_width, &new_height); + if (get_resized_size(gdk_pixbuf_get_width(pixbuf), + gdk_pixbuf_get_height(pixbuf), + avail_width, avail_height, + &new_width, &new_height)) + return gdk_pixbuf_scale_simple + (pixbuf, new_width, new_height, GDK_INTERP_BILINEAR); - return gdk_pixbuf_scale_simple - (pixbuf, new_width, new_height, GDK_INTERP_BILINEAR); + g_object_ref(pixbuf); + return pixbuf; } -static void get_resized_size(gint w, gint h, gint aw, gint ah, - gint *sw, gint *sh) +static gboolean get_resized_size(gint w, gint h, gint aw, gint ah, + gint *sw, gint *sh) { gfloat wratio = 1.0; gfloat hratio = 1.0; @@ -188,7 +190,7 @@ static void get_resized_size(gint w, gint h, gint aw, gint ah, if (w <= aw && h <= ah) { *sw = w; *sh = h; - return; + return FALSE; } if (w > aw) @@ -214,6 +216,8 @@ static void get_resized_size(gint w, gint h, gint aw, gint ah, *sh = (gint)(h * ratio); } } + + return TRUE; } static gint button_press_cb(GtkWidget *widget, GdkEventButton *event, |