[Xfce4-commits] <ristretto:master> Solve problem with size-calculation in size_prepared callback
Stephan Arts
noreply at xfce.org
Thu Oct 27 16:58:03 CEST 2011
Updating branch refs/heads/master
to 1b3d51c0a2f5137defb2c5edd4faaee0ce09a68d (commit)
from 9022733738fee45adb141829e577b37c63fa171a (commit)
commit 1b3d51c0a2f5137defb2c5edd4faaee0ce09a68d
Author: Stephan Arts <stephan at xfce.org>
Date: Thu Oct 27 16:53:22 2011 +0200
Solve problem with size-calculation in size_prepared callback
< pixbuf_width = width / height * s_width
should be
> pixbuf_width = width / height * s_height
src/image_viewer.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/image_viewer.c b/src/image_viewer.c
index c3ffaaf..36d0832 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -1704,7 +1704,11 @@ cb_rstto_image_loader_area_prepared (GdkPixbufLoader *loader, RsttoImageViewerTr
}
static void
-cb_rstto_image_loader_size_prepared (GdkPixbufLoader *loader, gint width, gint height, RsttoImageViewerTransaction *transaction)
+cb_rstto_image_loader_size_prepared (
+ GdkPixbufLoader *loader,
+ gint width,
+ gint height,
+ RsttoImageViewerTransaction *transaction)
{
gint s_width = gdk_screen_get_width (default_screen);
gint s_height = gdk_screen_get_height (default_screen);
@@ -1726,12 +1730,18 @@ cb_rstto_image_loader_size_prepared (GdkPixbufLoader *loader, gint width, gint h
if(((gdouble)width / (gdouble)s_width) < ((gdouble)height / (gdouble)s_height))
{
transaction->image_scale = (gdouble)s_width / (gdouble)width;
- gdk_pixbuf_loader_set_size (loader, s_width, (gint)((gdouble)height/(gdouble)width*(gdouble)s_width));
+ gdk_pixbuf_loader_set_size (
+ loader,
+ s_width,
+ (gint)((gdouble)height/(gdouble)width*(gdouble)s_width));
}
else
{
transaction->image_scale = (gdouble)s_height / (gdouble)height;
- gdk_pixbuf_loader_set_size (loader, (gint)((gdouble)width/(gdouble)height*(gdouble)s_width), s_height);
+ gdk_pixbuf_loader_set_size (
+ loader,
+ (gint)((gdouble)width/(gdouble)height*(gdouble)s_height),
+ s_height);
}
}
else
More information about the Xfce4-commits
mailing list