[Goodies-commits] r2288 - ristretto/trunk/src
Stephan Arts
stephan at xfce.org
Sun Dec 31 01:48:38 CET 2006
Author: stephan
Date: 2006-12-31 00:48:38 +0000 (Sun, 31 Dec 2006)
New Revision: 2288
Modified:
ristretto/trunk/src/picture_viewer.c
Log:
improved rendering of scaled images
Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c 2006-12-30 17:16:02 UTC (rev 2287)
+++ ristretto/trunk/src/picture_viewer.c 2006-12-31 00:48:38 UTC (rev 2288)
@@ -256,8 +256,8 @@
pixbuf,
0,
0,
- (widget->allocation.width-gdk_pixbuf_get_width(pixbuf))/2,
- (widget->allocation.height-gdk_pixbuf_get_height(pixbuf))/2,
+ (widget->allocation.width-gdk_pixbuf_get_width(pixbuf))<0?0:(widget->allocation.width-gdk_pixbuf_get_width(pixbuf))/2,
+ (widget->allocation.height-gdk_pixbuf_get_width(pixbuf))<0?0:(widget->allocation.width-gdk_pixbuf_get_width(pixbuf))/2,
gdk_pixbuf_get_width(pixbuf),
gdk_pixbuf_get_height(pixbuf),
GDK_RGB_DITHER_NONE,
@@ -302,8 +302,6 @@
static void
cb_rstto_picture_viewer_value_changed(GtkAdjustment *adjustment, RsttoPictureViewer *viewer)
{
- g_debug("value changed");
-
gdouble width = (gdouble)gdk_pixbuf_get_width(viewer->src_pixbuf);
gdouble height = (gdouble)gdk_pixbuf_get_height(viewer->src_pixbuf);
@@ -312,7 +310,7 @@
viewer->hadjustment->value / viewer->scale >= 0? viewer->hadjustment->value / viewer->scale : 0,
viewer->vadjustment->value / viewer->scale >= 0? viewer->vadjustment->value / viewer->scale : 0,
((GTK_WIDGET(viewer)->allocation.width/viewer->scale)+1) < width?GTK_WIDGET(viewer)->allocation.width/viewer->scale+1:width,
- ((GTK_WIDGET(viewer)->allocation.width/viewer->scale)+1) < height?GTK_WIDGET(viewer)->allocation.width/viewer->scale+1:height);
+ ((GTK_WIDGET(viewer)->allocation.height/viewer->scale)+1) < height?GTK_WIDGET(viewer)->allocation.height/viewer->scale+1:height);
if(viewer->dst_pixbuf)
{
More information about the Goodies-commits
mailing list